Reputation: 161
How to solve this error?
Trying to get property 'name' of non-object
{{ Auth::user()->name }}
Upvotes: 0
Views: 215
Reputation: 34848
Without Auth::check(), you can use blade directives take a look
Auth::check()
@guest // Show content if unauthenticated @endguest @auth // The data only available for auth user {{ Auth::user()->name }} @endauth
Upvotes: 1