mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 10:06:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			891 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			891 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';
 | 
						|
 | 
						|
    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'),
 | 
						|
        ];
 | 
						|
    }
 | 
						|
}
 |