Reference
Artisan Commands
On this page
systemroles:migrate#
php artisan systemroles:migrateRuns only the package's migrations from vendor/baberuka/systemroles/database/migrations. Creates the migrations table if needed. Prints the migrations it ran, or "No SystemRoles migrations to run."
Use it when you want to install the package tables without running your app's own pending migrations.
The package also registers its migrations with Laravel, so php artisan migrate runs them as well. Each migration skips its table if it already exists.
systemroles:sync#
php artisan systemroles:sync
php artisan systemroles:sync --classes| Option | Effect |
|---|---|
| (none) | Stores every registered route in system_. Prints "Routes: X added, Y updated." |
--classes |
Also scans controller_ and stores every controller in system_ |
Routes are matched on method + URL. Controllers are matched on namespace + class name. Neither removes rows for routes or controllers that no longer exist.
Run it:
- after each deploy, if
scan_on_requestisfalse; - after adding routes or controllers you want to manage.
In a deploy script:
php artisan migrate --force
php artisan systemroles:sync --classes
php artisan config:cache
php artisan route:cacheThe command reads the routes Laravel has loaded, so it works with or without a route cache.
Seeding#
Not a command of its own, but part of setup:
php artisan db:seed --class="Database\Seeders\SystemRolesSeeder"Creates the four default roles (ids 1–4) if they don't exist. Call it from your own DatabaseSeeder to include it in php artisan db:seed:
public function run(): void
{
$this->call(\Database\Seeders\SystemRolesSeeder::class);
}