Skip to content

Commit 0199b2f

Browse files
authored
[Bug} Removed guest role (alexjustesen#776)
1 parent c5e6d9b commit 0199b2f

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

app/Console/Commands/UpdateUserRole.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ public function handle()
4444
label: 'What role should the user have?',
4545
options: [
4646
'admin' => 'Admin',
47-
'guest' => 'Guest',
4847
'user' => 'User',
4948
],
50-
default: 'guest'
49+
default: 'user'
5150
);
5251

5352
$confirmed = confirm(

app/Filament/Resources/UserResource.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ public static function form(Form $form): Form
7373
Forms\Components\Select::make('role')
7474
->options([
7575
'admin' => 'Admin',
76-
'guest' => 'Guest',
7776
'user' => 'User',
7877
])
79-
->default('guest')
78+
->default('user')
8079
->disabled(fn (): bool => ! auth()->user()->is_admin || auth()->user()->is_user)
8180
->required(),
8281
])
@@ -119,8 +118,7 @@ public static function table(Table $table): Table
119118
->badge()
120119
->color(fn (string $state): string => match ($state) {
121120
'admin' => 'success',
122-
'guest' => 'gray',
123-
'user' => 'info',
121+
'user' => 'gray',
124122
}),
125123
Tables\Columns\TextColumn::make('updated_at')
126124
->label('Last updated')
@@ -130,7 +128,6 @@ public static function table(Table $table): Table
130128
Tables\Filters\SelectFilter::make('role')
131129
->options([
132130
'admin' => 'Admin',
133-
'guest' => 'Guest',
134131
'user' => 'User',
135132
]),
136133
])

app/Models/User.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ protected function isAdmin(): Attribute
6666
);
6767
}
6868

69-
/**
70-
* Determine if the user has a guest role.
71-
*/
72-
protected function isGuest(): Attribute
73-
{
74-
return Attribute::make(
75-
get: fn (mixed $value, array $attributes): bool => $attributes['role'] == 'guest' || blank($attributes['role']),
76-
);
77-
}
78-
7969
/**
8070
* Determine if the user has a user role.
8171
*/

0 commit comments

Comments
 (0)