57 lines
1.3 KiB
PHP
57 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Users;
|
|
|
|
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
|
use App\Filament\Resources\Users\Pages\ListUsers;
|
|
use App\Filament\Resources\Users\Schemas\UserForm;
|
|
use App\Filament\Resources\Users\Tables\UsersTable;
|
|
use App\Models\User;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Table;
|
|
|
|
class UserResource extends Resource
|
|
{
|
|
protected static ?string $model = User::class;
|
|
|
|
protected static ?int $navigationSort = 31;
|
|
|
|
protected static string|\BackedEnum|null $navigationIcon = 'lucide-user';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
protected static ?string $cluster = AdministratorCluster::class;
|
|
|
|
protected static string|\UnitEnum|null $navigationGroup = 'User';
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return UserForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return UsersTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListUsers::route('/'),
|
|
];
|
|
}
|
|
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
return parent::getEloquentQuery()->count();
|
|
}
|
|
}
|