'employee', 'plural' => 'employees', ]; } protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedUsers; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Employees; protected static ?int $navigationSort = 1; protected static ?string $recordTitleAttribute = 'full_name'; protected static bool $isGloballySearchable = true; public static function form(Schema $schema): Schema { return EmployeeForm::configure($schema); } public static function infolist(Schema $schema): Schema { return EmployeeInfolist::configure($schema); } public static function table(Table $table): Table { return EmployeesTable::configure($table); } /** * @return array */ public static function getGloballySearchableAttributes(): array { return [ 'employee_number', 'full_name', 'phone', 'department.name', 'position.name', ]; } /** * @return array */ public static function getGlobalSearchResultDetails(Model $record): array { /** @var Employee $record */ return [ __('hr.fields.employee_number') => $record->employee_number, __('hr.fields.department') => $record->department?->name ?? '—', __('hr.fields.position') => $record->position?->name ?? '—', ]; } public static function getRelations(): array { return [ VacationsRelationManager::class, SickLeavesRelationManager::class, UnpaidLeavesRelationManager::class, DisciplinaryReportsRelationManager::class, ExplanationsRelationManager::class, BonusesRelationManager::class, GiftsRelationManager::class, DocumentsRelationManager::class, ]; } public static function getPages(): array { return [ 'index' => ListEmployees::route('/'), 'create' => CreateEmployee::route('/create'), 'view' => ViewEmployee::route('/{record}'), 'edit' => EditEmployee::route('/{record}/edit'), ]; } public static function getRecordRouteBindingEloquentQuery(): Builder { return parent::getRecordRouteBindingEloquentQuery() ->withoutGlobalScopes([ SoftDeletingScope::class, ]); } }