profile
viewpoint

Ask questionsLaravel Sanctum guard issue

Hello,

I am using Laravel AirLock to authenticate SPA. The auth.config file has default guard as "web" and the order of guards array also contains first key as "web".

When I create any roles or permissions using Role::create(['name' => 'admin')] or Permission::create(['name' => 'access-config']) it creates with guard name as "airlock".

Do we need to change any configuration if use AirLock authentication method?

spatie/laravel-permission

Answer questions hkan

@Ragash yeah the whole auto-discovery thing is rather flimsy. See the last commit on my fork for the simplest way to change it.

useful!

Related questions

Call to undefined method App\\User::hasAnyRole() hot 2
There is no permission named `edit articles` for guard `web`. hot 2
Error: Non-static method App\User::role() should not be called statically hot 2
HasRoles not found hot 1
Auditing model changes with owen-it/laravel-auditing hot 1
Why is role_has_permissions a separate table? hot 1
assignRole not working when try to assign role to the user hot 1
PermissionDoesNotExist exception not raised hot 1
Call to undefined method App\\User::hasAnyRole() hot 1
@can blade with guard name not working hot 1
The given role or permission should use guard `admin` instead of `web`. hot 1
source:https://uonfu.com/
Github User Rank List