diff --git a/app/Containers/AppSection/Authorization/Data/Seeders/AuthorizationGivePermissionsToRolesSeeder_3.php b/app/Containers/AppSection/Authorization/Data/Seeders/AuthorizationGivePermissionsToRolesSeeder_3.php index 8792596a7..6b845fe14 100644 --- a/app/Containers/AppSection/Authorization/Data/Seeders/AuthorizationGivePermissionsToRolesSeeder_3.php +++ b/app/Containers/AppSection/Authorization/Data/Seeders/AuthorizationGivePermissionsToRolesSeeder_3.php @@ -4,7 +4,6 @@ use App\Containers\AppSection\Authorization\Tasks\GetAllPermissionsTask; use App\Ship\Parents\Seeders\Seeder as ParentSeeder; -use Spatie\Permission\Models\Role; class AuthorizationGivePermissionsToRolesSeeder_3 extends ParentSeeder { @@ -12,9 +11,10 @@ public function run(): void { // Give all permissions to 'admin' role on all Guards ---------------------------------------------------------------- $adminRoleName = config('appSection-authorization.admin_role'); + $roleModel = config('permission.models.role'); foreach (array_keys(config('auth.guards')) as $guardName) { $allPermissions = app(GetAllPermissionsTask::class)->whereGuard($guardName)->run(true); - $adminRole = Role::findByName($adminRoleName, $guardName); + $adminRole = $roleModel::findByName($adminRoleName, $guardName); $adminRole->givePermissionTo($allPermissions); }