ErrorException, Attempt to read property "name" on null, {{ Auth::user()->name }}
The login works fine, this happens when I leave the computer alone for a few hours and when I return it throws an error message Auth::user()->name, in the dashboard this must be because the session expired, but the query is I can control this? something that sends the user back to login instead of sending this error.
Then when you refresh the page, the application attempts to show the current page and tries to get the name of the user, but there isn't any user logged in any more.
To avoid the error, you can for example :
protect the routes with the auth middleware
wrap the Auth::user()->name within @auth ... @endauth
@Snapey I think it has to do with the time of the session that is in config/session.php but what I am looking for is to be able to capture this error and return it to login and not show me the web with the error. although if I do F5 to update the error disappears. then it could also be some cache.