forgetCachedPermissions(); $seed = new \Database\Seeders\RoleSeeder(); if (! method_exists($seed, 'run')) { $this->error('RoleSeeder non disponibile.'); return 1; } $seed->run(); app(PermissionRegistrar::class)->forgetCachedPermissions(); if (! $this->option('assign-to-existing')) { $this->info('Ruoli/permessi sincronizzati (create/firstOrCreate).'); $this->info("Suggerimento: usa --assign-to-existing per riallineare i ruoli."); return 0; } // RoleSeeder giĆ  assegna: qui solo conferma e report. $this->info('Ruoli/permessi sincronizzati e assegnati (vedi RoleSeeder).'); $this->line('Ruoli: ' . Role::query()->count() . ' | Permessi: ' . Permission::query()->count()); return 0; } }