columns([ Tables\Columns\TextColumn::make('title') ->searchable(), Tables\Columns\TextColumn::make('path')->label('Путь') ->searchable(), Tables\Columns\TextColumn::make('is_registered')->getStateUsing(function ($record) { return ($record->is_registered) ? 'true' : 'false'; }) ->badge() ->color(fn (string $state): string => match ($state) { 'false' => 'gray', 'true' => 'success', }) ->label('Зарезервированная страница'), Tables\Columns\TextColumn::make('is_url')->getStateUsing(function ($record) { return ($record->is_url) ? 'true' : 'false'; }) ->badge() ->color(fn (string $state): string => match ($state) { 'false' => 'gray', 'true' => 'success', }) ->label('Ссылка на другой ресурс'), Tables\Columns\TextColumn::make('code') ->badge() ->color(fn (string $state): string => match ($state) { '200' => 'success', '404' => 'warning', '500' => 'danger', }) ->label('Код страницы'), ]) ->filters([ ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ SectionRelationManager::class, ]; } public static function getPages(): array { return [ 'index' => Pages\ListPages::route('/'), 'create' => Pages\CreatePage::route('/create'), 'edit' => Pages\EditPage::route('/{record}/edit'), ]; } }