Replies: 2 comments
-
Make your own eloquent model for |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I'm developing an admin panel and API (for nuxt js PWA) with laravel. In my project, there are two guards exists:
now I have this roles (with this package):
For example, in my project, a user already has the first role when I want to assign the third role for this user with admin panel that works with laravel web guard but an error occurs:
Spatie\Permission\Exceptions\RoleDoesNotExist
There is no role named
adviser
.But For the second role, there is no problem.
It seems when I logged in into the admin panel I can only assign the role with web guard, not api guard. why exactly?
How can I fix that?
Beta Was this translation helpful? Give feedback.
All reactions