The given role or permission should use guard ` instead of
web`. when using calebporzio/parental
#2108
Unanswered
charles-prof
asked this question in
Q&A
Replies: 2 comments
-
After adding protected file: app\Models\Admin.php
solution: add protected |
Beta Was this translation helpful? Give feedback.
0 replies
-
In my scenario I need that User Model can be associate with roles for multiple guards, to accomplish that I just define namespace App\Models;
Class User extends UserModel
{
// ...
protected array $guard_name = ['api', 'web'];
// ...
} With that, I can assign model to multiple guards. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The following exception is thrown when assigning roles ($user->assignRole($role);) or permissions ( $user->givePermissionTo($permissions);) to user model.
Actual model class is a child model (admin or student) of user model, so
$class === $model;
fails ingetConfigGuards()
as $model is User and $class is AdminAnybody else using calebporzio/parental ? I'm referencing this article
Beta Was this translation helpful? Give feedback.
All reactions