@@ -34,13 +34,13 @@ public static function configure(Table $table): Table
34
34
->label ('Name ' )
35
35
->circular ()
36
36
->width ('0% ' )
37
- ->defaultImageUrl (fn (?string $ state ): string => $ state ? sprintf ('https://avatars.githubusercontent.com/u/%s ' , $ state ) : asset ('images/laravelio-icon-gray.svg ' )),
37
+ ->defaultImageUrl (fn (?string $ state ): string => $ state ? sprintf ('https://avatars.githubusercontent.com/u/%s ' , $ state ) : asset ('images/laravelio-icon-gray.svg ' )),
38
38
39
39
TextColumn::make ('username ' )
40
40
->label ('' )
41
41
->searchable ()
42
- ->formatStateUsing (fn (User $ user ): ?string => $ user ->name )
43
- ->description (fn (User $ user ): ?string => $ user ->username ),
42
+ ->formatStateUsing (fn (User $ user ): ?string => $ user ->name )
43
+ ->description (fn (User $ user ): ?string => $ user ->username ),
44
44
45
45
TextColumn::make ('email ' )
46
46
->searchable ()
@@ -49,7 +49,7 @@ public static function configure(Table $table): Table
49
49
TextColumn::make ('type ' )
50
50
->label ('Role ' )
51
51
->badge ()
52
- ->formatStateUsing (fn (string $ state ): string => match ($ state ) {
52
+ ->formatStateUsing (fn (string $ state ): string => match ($ state ) {
53
53
'1 ' => 'User ' ,
54
54
'2 ' => 'Moderator ' ,
55
55
'3 ' => 'Admin ' ,
@@ -63,7 +63,7 @@ public static function configure(Table $table): Table
63
63
TextColumn::make ('created_at ' )
64
64
->label ('Joined on ' )
65
65
->dateTime ()
66
- ->sortable ()
66
+ ->sortable (),
67
67
])
68
68
->filters ([
69
69
SelectFilter::make ('type ' )
@@ -75,11 +75,11 @@ public static function configure(Table $table): Table
75
75
76
76
TernaryFilter::make ('banned_at ' )
77
77
->label ('Banned ' )
78
- ->nullable ()
78
+ ->nullable (),
79
79
])
80
80
->recordActions ([
81
81
Action::make ('view ' )
82
- ->url (fn (User $ user ): string => route ('profile ' , $ user ->username ))
82
+ ->url (fn (User $ user ): string => route ('profile ' , $ user ->username ))
83
83
->openUrlInNewTab ()
84
84
->icon ('heroicon-s-eye ' ),
85
85
@@ -89,30 +89,30 @@ public static function configure(Table $table): Table
89
89
VerifyAuthor::dispatchSync ($ user );
90
90
91
91
Notification::make ()
92
- ->title ($ user ->name . ' is now a verified author. ' )
92
+ ->title ($ user ->name . ' is now a verified author. ' )
93
93
->success ()
94
94
->send ();
95
95
})
96
96
->openUrlInNewTab ()
97
97
->color ('primary ' )
98
98
->icon ('heroicon-s-check-circle ' )
99
99
->requiresConfirmation ()
100
- ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::ADMIN , $ user ) && ! $ user ->isVerifiedAuthor ()),
100
+ ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::ADMIN , $ user ) && ! $ user ->isVerifiedAuthor ()),
101
101
102
102
Action::make ('unverify_author ' )
103
103
->action (function (User $ user ) {
104
104
UnVerifyAuthor::dispatchSync ($ user );
105
105
106
106
Notification::make ()
107
- ->title ($ user ->name . '\'s threads have been deleted. ' )
107
+ ->title ($ user ->name . '\'s threads have been deleted. ' )
108
108
->success ()
109
109
->send ();
110
110
})
111
111
->openUrlInNewTab ()
112
112
->color ('danger ' )
113
113
->icon ('heroicon-s-x-circle ' )
114
114
->requiresConfirmation ()
115
- ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::ADMIN , $ user ) && $ user ->isVerifiedAuthor ()),
115
+ ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::ADMIN , $ user ) && $ user ->isVerifiedAuthor ()),
116
116
117
117
Action::make ('ban_author ' )
118
118
->schema ([
@@ -134,7 +134,7 @@ public static function configure(Table $table): Table
134
134
135
135
Notification::make ()
136
136
->title (
137
- $ user ->name . ' is now banned. ' . ($ data ['delete_threads ' ] ? ' And all his threads are now deleted. ' : '' )
137
+ $ user ->name . ' is now banned. ' . ($ data ['delete_threads ' ] ? ' And all his threads are now deleted. ' : '' )
138
138
)
139
139
->success ()
140
140
->send ();
@@ -144,45 +144,45 @@ public static function configure(Table $table): Table
144
144
->color ('danger ' )
145
145
->icon ('heroicon-s-check-circle ' )
146
146
->requiresConfirmation ()
147
- ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::BAN , $ user ) && ! $ user ->isBanned ()),
147
+ ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::BAN , $ user ) && ! $ user ->isBanned ()),
148
148
149
149
Action::make ('unban_author ' )
150
150
->action (function (User $ user ) {
151
151
152
152
UnbanUser::dispatchSync ($ user );
153
153
154
154
Notification::make ()
155
- ->title ($ user ->name . ' is no longer a banned user. ' )
155
+ ->title ($ user ->name . ' is no longer a banned user. ' )
156
156
->success ()
157
157
->send ();
158
158
})
159
159
->openUrlInNewTab ()
160
160
->color ('primary ' )
161
161
->icon ('heroicon-s-x-circle ' )
162
162
->requiresConfirmation ()
163
- ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::BAN , $ user ) && $ user ->isBanned ()),
163
+ ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::BAN , $ user ) && $ user ->isBanned ()),
164
164
165
165
Action::make ('delete_threads ' )
166
166
->action (function (User $ user ) {
167
167
DeleteUserThreads::dispatchSync ($ user );
168
168
169
169
Notification::make ()
170
- ->title ($ user ->name . '\'s threads have been deleted. ' )
170
+ ->title ($ user ->name . '\'s threads have been deleted. ' )
171
171
->success ()
172
172
->send ();
173
173
})
174
174
->openUrlInNewTab ()
175
175
->color ('danger ' )
176
176
->icon ('heroicon-s-archive-box-x-mark ' )
177
177
->requiresConfirmation ()
178
- ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::DELETE , $ user )),
178
+ ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::DELETE , $ user )),
179
179
180
180
DeleteAction::make ()
181
- ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::DELETE , $ user )),
181
+ ->visible (fn (User $ user ): bool => auth ()->user ()->can (UserPolicy::DELETE , $ user )),
182
182
]),
183
183
])
184
184
->toolbarActions ([
185
- //
185
+ //
186
186
]);
187
187
}
188
188
}
0 commit comments