*/ 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, ]); } }