Fix bug where AppServiceProvider trying to fetch authenticated user's name even if no authentication had taken place
MODIFY
app/Providers/AppServiceProvider.php
app/Providers/AppServiceProvider.php
@@ -10,7 +10,7 @@ class AppServiceProvider extends ServiceProvider {
public function boot() {
view()->composer('*', function($view) {
$view->with([
- 'userName' => Auth::user()->name
+ 'userName' => Auth::check() ? Auth::user()->name : null
]);
});
}

Fix bug where AppServiceProvider trying to fetch authenticated user's name even if no authentication had taken place