getTranslation('title', app()->getLocale()); } /** * Global search looks inside the admin's current language only, so results * read the way they expect rather than surfacing a stray English match. * * @return array */ public static function getGloballySearchableAttributes(): array { return ['title->'.app()->getLocale()]; } public static function form(Schema $schema): Schema { return PageForm::configure($schema); } public static function table(Table $table): Table { return PagesTable::configure($table); } public static function getRelations(): array { return [ ReviewsRelationManager::class, RevisionsRelationManager::class, ]; } public static function getPages(): array { return [ 'index' => ListPages::route('/'), 'create' => CreatePage::route('/create'), 'edit' => EditPage::route('/{record}/edit'), ]; } public static function getRecordRouteBindingEloquentQuery(): Builder { return parent::getRecordRouteBindingEloquentQuery() ->withoutGlobalScopes([SoftDeletingScope::class]); } public static function getNavigationBadge(): ?string { $drafts = static::getModel()::query()->where('status', 'draft')->count(); return $drafts > 0 ? (string) $drafts : null; } }