0

我用 Jetstream 和 Livewire 创建了一个新的 Laravel 8 应用程序。当我向任何视图发出 GET 请求时,会使用消息启动 ErrorException

试图获取非对象的属性“user_id”

在由 Jetstream\Livewire 自动生成的 navigation-dropdown.blade.php 上。我一直在寻找这个user_id,但在代码的任何部分都没有找到。

4

1 回答 1

0

Check that if user has team in the blade view.

resources/views/navigation-dropdown.blade.php

In line 61:

- @if (Laravel\Jetstream\Jetstream::hasTeamFeatures())
+ @if (Laravel\Jetstream\Jetstream::hasTeamFeatures() && Auth::user()->current_team_id)

In line 162:

- @if (Laravel\Jetstream\Jetstream::hasTeamFeatures())
+ @if (Laravel\Jetstream\Jetstream::hasTeamFeatures() && Auth::user()->current_team_id)
于 2020-11-26T13:43:57.527 回答