is there a way to set the dynamic scopes of laravel passport instead of typing manually?
I tried to create a table(MySql) with scope name and description, created a model Scope, but that model is not working in AuthServiceProvider
Passport::tokensCan([
'view-dashboard' => 'View the contents of dashboard',
'view-reports' => 'View the detailed reports'
]);
How can i make the scopes dynamic ? i want to manage the scopes based on roles of users by creating some interface
Edit: I could relate the solution to my present situation, and it really makes sense but can you just help we with the code of line
$token->scopes = user_scopes;
i am getting an Exception error Attempt to assign property scopes of non-object in the user model as i have added your code in my User class as mentioned. Can you just clear me how can i fetch the scope ids?