Deploy / deploy (push) Successful in 29s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
550 B
PHP
22 lines
550 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Spatie\Permission\Models\Role;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
app()[\Spatie\Permission\PermissionRegistrar::class]->forgetCachedPermissions();
|
|
|
|
foreach (['sms-admin', 'sms-manager', 'sms-viewer'] as $role) {
|
|
Role::firstOrCreate(['name' => $role, 'guard_name' => 'web']);
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Role::whereIn('name', ['sms-admin', 'sms-manager', 'sms-viewer'])->delete();
|
|
}
|
|
};
|