Files
panel/app/Filament/Admin/Resources/UserResource.php

59 lines
1.4 KiB
PHP
Raw Normal View History

2024-03-24 01:48:03 -04:00
<?php
namespace App\Filament\Admin\Resources;
2024-03-24 01:48:03 -04:00
use App\Filament\Admin\Resources\UserResource\Pages;
use App\Filament\Admin\Resources\UserResource\RelationManagers;
2024-03-24 01:48:03 -04:00
use App\Models\User;
use Filament\Resources\Resource;
class UserResource extends Resource
{
protected static ?string $model = User::class;
2024-03-30 02:15:56 -04:00
protected static ?string $navigationIcon = 'tabler-users';
2024-03-24 01:48:03 -04:00
protected static ?string $recordTitleAttribute = 'username';
public static function getNavigationLabel(): string
{
return trans('admin/user.nav_title');
}
public static function getModelLabel(): string
{
return trans('admin/user.model_label');
}
public static function getPluralModelLabel(): string
{
return trans('admin/user.model_label_plural');
}
public static function getNavigationGroup(): ?string
{
return trans('admin/dashboard.user');
}
2024-05-15 14:11:09 -04:00
public static function getNavigationBadge(): ?string
{
return static::getModel()::count() ?: null;
}
2024-03-24 01:48:03 -04:00
public static function getRelations(): array
{
return [
RelationManagers\ServersRelationManager::class,
2024-03-24 01:48:03 -04:00
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListUsers::route('/'),
2024-12-13 09:21:37 +01:00
'create' => Pages\CreateUser::route('/create'),
2024-03-24 01:48:03 -04:00
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}
}