File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
app/Filament/Resources/ApiTokens Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 88use Filament \Resources \Resource ;
99use Filament \Schemas \Schema ;
1010use Filament \Tables \Table ;
11+ use Illuminate \Support \Facades \Auth ;
1112use Laravel \Sanctum \PersonalAccessToken ;
1213
1314class ApiTokenResource extends Resource
@@ -22,6 +23,16 @@ class ApiTokenResource extends Resource
2223
2324 protected static ?string $ pluralLabel = 'API Tokens ' ;
2425
26+ public static function canAccess (): bool
27+ {
28+ return Auth::check () && Auth::user ()->is_admin ;
29+ }
30+
31+ public static function shouldRegisterNavigation (): bool
32+ {
33+ return Auth::check () && Auth::user ()->is_admin ;
34+ }
35+
2536 public static function form (Schema $ schema ): Schema
2637 {
2738 return $ schema ->components (ApiTokenForm::schema ());
You can’t perform that action at this time.
0 commit comments