mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 10:06:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			38 lines
		
	
	
		
			896 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			896 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Filament\Resources;
 | 
						|
 | 
						|
use App\Filament\Resources\UserResource\Pages;
 | 
						|
use App\Filament\Resources\UserResource\RelationManagers;
 | 
						|
use App\Models\User;
 | 
						|
use Filament\Resources\Resource;
 | 
						|
 | 
						|
class UserResource extends Resource
 | 
						|
{
 | 
						|
    protected static ?string $model = User::class;
 | 
						|
 | 
						|
    protected static ?string $navigationIcon = 'tabler-users';
 | 
						|
 | 
						|
    protected static ?string $recordTitleAttribute = 'username';
 | 
						|
 | 
						|
    public static function getNavigationBadge(): ?string
 | 
						|
    {
 | 
						|
        return static::getModel()::count() ?: null;
 | 
						|
    }
 | 
						|
 | 
						|
    public static function getRelations(): array
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            RelationManagers\ServersRelationManager::class,
 | 
						|
        ];
 | 
						|
    }
 | 
						|
 | 
						|
    public static function getPages(): array
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            'index' => Pages\ListUsers::route('/'),
 | 
						|
            'edit' => Pages\EditUser::route('/{record}/edit'),
 | 
						|
        ];
 | 
						|
    }
 | 
						|
}
 |