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

whfamily2006's avatar

How to Assign Permission to Roles using Laravel-Permissions Package

i have following situation... Roles: Admin, Staff Permission: student_update

  1. Insert this above permission into permissions table.
  2. Assign Roles to specific users...
  3. Assign Permission to Admin User in permission_roles table.

now i want to show edit button to just admin and for this i use this following code...

@can( 'student_update' )
'<a style=\'color:#000\'  class=\'fa fa-edit\' title=\'Edit\' href=' . url( 'admin/students/1' ) . '></a> ';
@endcan

i want to assign permissions role base not user specific....

0 likes
0 replies

Please or to participate in this conversation.