jeudi 28 novembre 2019

How can I verify if the user is logged in? I need to show stuff only if users are loged in.This is the code Im using

@if(auth()->user()->isAdmin())

content

@endif

@if(auth()->user()->isNormal())

content

@endif

and then if the is not logged in i get this error:

Call to a member function isAdmin() on null (View: C:\Users\marco\laravel projects\final\resources\views\layouts\user.blade.php)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire