mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-01 00:06:52 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			41 lines
		
	
	
		
			951 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			951 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Filament\Resources;
 | |
| 
 | |
| use App\Filament\Resources\ApiKeyResource\Pages;
 | |
| use App\Models\ApiKey;
 | |
| use Filament\Resources\Resource;
 | |
| 
 | |
| class ApiKeyResource extends Resource
 | |
| {
 | |
|     protected static ?string $model = ApiKey::class;
 | |
|     protected static ?string $label = 'API Key';
 | |
|     protected static ?string $navigationIcon = 'tabler-key';
 | |
|     protected static ?string $navigationGroup = 'Advanced';
 | |
| 
 | |
|     public static function getNavigationBadge(): ?string
 | |
|     {
 | |
|         return static::getModel()::where('key_type', '2')->count() ?: null;
 | |
|     }
 | |
| 
 | |
|     public static function canEdit($record): bool
 | |
|     {
 | |
|         return false;
 | |
|     }
 | |
| 
 | |
|     public static function getRelations(): array
 | |
|     {
 | |
|         return [
 | |
|             //
 | |
|         ];
 | |
|     }
 | |
| 
 | |
|     public static function getPages(): array
 | |
|     {
 | |
|         return [
 | |
|             'index' => Pages\ListApiKeys::route('/'),
 | |
|             'create' => Pages\CreateApiKey::route('/create'),
 | |
|         ];
 | |
|     }
 | |
| }
 | 
