I have following tables:
Role Table
- ID
- Title
Permission Table
- ID
- Title
- Role_id
- Permissions ( like : {test:"create","edit","update","delete"} )
Now after logging in how can I check through middleware whether that specific user has above permissions, whether he can create/edit/update/delete.
I don't want to specify the permissions or role name in routes.
Route::group(['permission'=>'create-user'] ...
Instead want to check with the help of middleware.
Route::group(['middleware'=>'authorization'] ...
So that I don't have to specify individual permissions in route each time new role and permissions to those role has been added.
Thankyou
via nasor