У меня есть приложение на Laravel 5.8. Каждый раз, когда пользователь долго остается в приложении, эта ошибка появляется
Попытка получить свойство 'name' необъекта (представление: C: \ xampp \ htdocs \ jairusreport \ resources \ views \ layouts \ header.blade.php)

В течение нескольких дней я боролся с какой-то конкретной ошибкой, и это действительно потратило мое время. Я сделал скриншот ошибки ниже.
Auth / LoginController
class LoginController extends Controller
{
use AuthenticatesUsers;
protected $redirectTo = '/dashboard';
protected function hasTooManyLoginAttempts ($request) {
$maxLoginAttempts = 2;
$lockoutTime = 5; // 5 minutes
return $this->limiter()->tooManyAttempts(
$this->throttleKey($request), $maxLoginAttempts, $lockoutTime
);
}
public function __construct()
{
$this->middleware('guest')->except('logout');
}
public function logout()
{
$user = Auth::user();
Log::info('User Logged Out. ', [$user]);
Auth::logout();
Session::flush();
return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/login');
}
}
В чем причина проблемы. Что мне делать, чтобы решить эту проблему.