Add HR resource labels and helper methods for various resources; update locale handling in user model and department factory
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Filament\Resources\Departments;
|
||||
|
||||
use App\Enums\NavigationGroup;
|
||||
use App\Filament\Concerns\HasHrResourceLabels;
|
||||
use App\Filament\Resources\Departments\Pages\CreateDepartment;
|
||||
use App\Filament\Resources\Departments\Pages\EditDepartment;
|
||||
use App\Filament\Resources\Departments\Pages\ListDepartments;
|
||||
@@ -14,18 +15,28 @@ use App\Filament\Resources\Departments\Schemas\DepartmentInfolist;
|
||||
use App\Filament\Resources\Departments\Tables\DepartmentsTable;
|
||||
use App\Models\Department;
|
||||
use BackedEnum;
|
||||
use UnitEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use UnitEnum;
|
||||
|
||||
class DepartmentResource extends Resource
|
||||
{
|
||||
use HasHrResourceLabels;
|
||||
|
||||
protected static ?string $model = Department::class;
|
||||
|
||||
protected static function hrLabelKeys(): array
|
||||
{
|
||||
return [
|
||||
'model' => 'department',
|
||||
'plural' => 'departments',
|
||||
];
|
||||
}
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBuildingOffice2;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Organization;
|
||||
|
||||
Reference in New Issue
Block a user