I installed the spatie to Laravel permission:
but when I tried to check if the user has rule , this problem appears:
Call to a member function contains() on null?
my code is:
@role('Admin')
<p>This message appears if the user is an admin </p>
@endrole
note: if I check using permission like this:
@can('show-post')
<p>This message appears if the user is an admin </p>
@endcan
it work, why using role doesn't work?