Skip to content

Commit 833e9ea

Browse files
committed
fix: update role guards
1 parent 41d43e8 commit 833e9ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/Console/Commands/AuthSwitch.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use Illuminate\Console\Command;
66
use Illuminate\Support\Env;
77
use Illuminate\Support\Facades\Artisan;
8+
use Spatie\Permission\Models\Role;
9+
810
use function Laravel\Prompts\select;
911

1012
class AuthSwitch extends Command
@@ -46,6 +48,8 @@ public function handle()
4648

4749
Env::writeVariable('AUTH_GUARD', $guard, base_path('.env'), true);
4850

51+
Role::query()->update(['guard_name' => $guard]);
52+
4953
if ($guard === 'web') {
5054
$this->replaceByPattern(base_path('bootstrap/app.php'), '->statefulApi()', true);
5155
} else if ($guard === 'api') {

0 commit comments

Comments
 (0)