Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AbdulBazith's avatar

spatie-laravel-permission shows other than the given permission why ?

guys iam working with a project.

i have installed spatie/laravel-permission

everything worked fine

i followed this link : https://scotch.io/tutorials/user-authorization-in-laravel-54-with-spatie-laravel-permission

but whats the problem is

i have given like this in my nav bar

@can('Add Student')

                        <li><a href="{{ route('StudentAdmission.create') }}"> Add Student Admission</a></li>

     @endcan


its a school project, so for a staff i have give a role teacher and for teacher i have given the permission add student addmission.

but other than this everything is showing in the nav bar.

iam unable to find out, like this i did for other nav bars with other roles and permission the same issue.

for a specific role i have given few permissions but other than that permissions remaining are shown why?

0 likes
1 reply
bobbybouwmann's avatar

Can you show how you created the roles for the user? And does the user actually have the connection in the database to this role or permission?

Please or to participate in this conversation.