小编Kir*_*Lyn的帖子

执行 Git 推送 Laravel 时不包含存储链接

我刚刚git push在我们的在线仓库中做了一个

当我检查在线仓库并检查public文件夹时,它显示了以下内容: 在此处输入图片说明

在我的本地仓库中,我的public文件夹中有这个:

在此处输入图片说明

我的本地有来自我的存储链接的存储文件夹。我猜这与.gitignore我的本地public文件夹内部有关。它包含了:

*
!.gitignore
Run Code Online (Sandbox Code Playgroud)

我的存储文件夹也是如此。在我们的 Online repo 里面storage/app/public在此处输入图片说明

在我的本地storage文件夹中:

在此处输入图片说明

user_images存在于我的本地仓库中。这是内部.gitignore

*
!.gitignore
Run Code Online (Sandbox Code Playgroud)

和外部.gitigore

*
!public/
!.gitignore
Run Code Online (Sandbox Code Playgroud)

我不太熟悉在.gitignore. 我希望确保无论我的本地存储和公共文件夹有什么,在线存储库也有。我该怎么做呢?

如果有误导性或不正确,请编辑我的标签。谢谢你。

这是根目录的内容.gitignore

/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
Run Code Online (Sandbox Code Playgroud)

我已删除/public/storage.gitignored,并试图做一个git push

Changes not staged for commit:
        modified:   .gitignore
Run Code Online (Sandbox Code Playgroud)

仍然,从我的本地仓库到在线仓库,没有什么是相同的?我可能错过了什么?

试过跑步 git check-ignore -v path/to/file

在我的根.gitignore: …

git laravel gitlab laravel-5.7

5
推荐指数
1
解决办法
3647
查看次数

尝试通过单击 Laravel VS Code 来访问代码中的文件

我正在使用 VS 代码 1.33.1

我试图通过执行 a 来访问我的代码中的文件,CTRL + Click但它似乎不起作用。

通过单击访问文件

如您所见,我想访问项目中某处的 AuthenticatesUsers 文件。执行此操作的单击快捷方式是什么?

laravel-5 visual-studio-code

3
推荐指数
1
解决办法
1446
查看次数

尝试获取非对象 ErrorException Laravel 的属性

我是 Laravel 的新手,并使用 Twitter Bootstrap 的一些帮助创建了一个小程序。

我正在尝试访问此路线:

http://127.0.0.1:8000/posts/create
Run Code Online (Sandbox Code Playgroud)

我收到这些错误

73427cb411f683691ba00d0846f7eda3c61bff74.php 第 4 行中的 2/2 ErrorException:尝试获取非对象的属性(查看:C:\xampp\htdocs\laravel\alquirozlaravel\resources\views\show-solo.blade.php)

in 73427cb411f683691ba00d0846f7eda3c61bff74.php line 4
at CompilerEngine->handleViewException(object(ErrorException), 1) in PhpEngine.php line 44
at PhpEngine->evaluatePath('C:\\xampp\\htdocs\\laravel\\alquirozlaravel\\storage\\framework\\views/73427cb411f683691ba00d0846f7eda3c61bff74.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'post' => null)) in CompilerEngine.php line 59
at CompilerEngine->get('C:\\xampp\\htdocs\\laravel\\alquirozlaravel\\resources\\views/show-solo.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'post' => null)) in View.php line 137
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-5 laravel-5.4

2
推荐指数
1
解决办法
3万
查看次数

使用 Cypress 断言时,类型“JQuery<HTMLElement>”上不存在属性“值”

我试图断言输入字段的值:

cy.get('[data-vv-name="item price"]')
    .then(response => {
        expect(response.value).to.be.equal('100')
    })
Run Code Online (Sandbox Code Playgroud)

但我收到一个错误:

Property 'value' does not exist on type 'JQuery<HTMLElement>'
Run Code Online (Sandbox Code Playgroud)

但是当我在控制台尝试代码时:

$('[data-vv-name="item price"]').value
Run Code Online (Sandbox Code Playgroud)

我能够得到正确的值'100'。我应该添加/更新什么才能使我的断言正确?我在这里错过了什么吗?

编辑

使用以下内容,我能够做出我的断言

expect((<HTMLInputElement>response[0]).value).to.be.equal(10)
Run Code Online (Sandbox Code Playgroud)

javascript cypress

2
推荐指数
1
解决办法
407
查看次数

在 Laravel 中列出所有突出显示时,TODO 突出显示不起作用

我希望显示我的文件中的所有内容TODO:FIXME:注释.blade.php。但它没有这样做,它只是在左下部分显示 0% 搜索,并且没有任何反应。

我将此设置粘贴到我的settings.json

"todohighlight.include": [
        "**/*.js",
        "**/*.jsx",
        "**/*.ts",
        "**/*.tsx",
        "**/*.html",
        "**/*.php",
        "**/*.css",
        "**/*.scss",
        "**/*.blade.php"
    ]
Run Code Online (Sandbox Code Playgroud)

我已经包含.blade.php在列表中,我是否遗漏了什么?我应该再粘贴一些东西吗?顺便说一句,我的 VS Code 版本是1.31.1.

如果我对这个问题的标记有误,我深表歉意,请告诉我,以便我进行编辑。

laravel visual-studio-code laravel-5.7

1
推荐指数
1
解决办法
3840
查看次数

如何将多个变量传递给单个视图Laravel?

在我的控制器中:

public function index()
{
    $userTotal = User::all();
    $userActive = User::where('status', '=', 'Active');
    $userInactive = User::where('status', '=', 'Inactive');
    $userOnAndOff = User::where('status', '=', 'OnAndOff');

    return view('member.home')
        ->with(compact('userTotal'))
        ->with(compact('userActive'))
        ->with(compact('userInactive'))
        ->with(compact('userOnAndOff'));
}
Run Code Online (Sandbox Code Playgroud)

在我看来:

<div class="card border-success">
    <div class="card-horizontal">
        <div class="card-body bg-success">
            <p class="card-text text-white bg-success text-md-center"><i class="fas fa-users fa-2x"></i></p>
        </div>
        <div class="card-body text-success">
            <p class="card-text">Registered Member: <strong>{{ $userTotal->count() }}</strong></p>
            <p class="card-text">Active Members: <strong>{{ $userActive->count() }}</strong></p>
            <p class="card-text">Active Members: <strong>{{ $userActive->count() }}</strong></p>
            <p class="card-text">Inactive Members: <strong>{{ $userInactive->count() }}</strong></p>
        </div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我正在尝试打印计数值,有没有更好的方法来编码控制器?

0
推荐指数
1
解决办法
1373
查看次数

将 .then 的内容分离到 Cypress 中的新函数

我有一个功能:

let animal: {
    animalObj: {
        name: string;
        randomInfo: string[]
    }
} = {
    animalObj: {
        name: '',
        randomInfo: ['']
    }
}

cy.request({
    method: 'POST',
    url: '/api/animal',
    body: animal
}).then($el => {
    animal.animalObj = $el.body.Order

    animal.animalObj.name = 'Rex'
    animal.animalObj.randomInfo = ["Likes to bark!"]
})
Run Code Online (Sandbox Code Playgroud)

如果可能的话,我想为最后两行创建一个新的自定义命令:

    animal.animalObj.name = 'Rex'
    animal.animalObj.randomInfo = ["Likes to bark!"]
Run Code Online (Sandbox Code Playgroud)

它需要一个 string 和 string[] ,同时将这两个值分配给namerandomInfo。这样,我只需要调用该自定义命令并提供 2 个动态值。

typescript cypress

0
推荐指数
1
解决办法
137
查看次数