schema([ Forms\Components\Section::make()->schema([ Forms\Components\Grid::make()->schema([ Forms\Components\TextInput::make('title')->label('Название категории')->required() ->live(onBlur: true) ->afterStateUpdated(function (string $operation, string|null $state, Forms\Set $set) { $set('slug', Str::slug($state)); }), TextInput::make('slug')->label('Текстовый идентификатор категории')->unique(ignoreRecord: true)->readOnly()->required(), ]), ]), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('id')->label('ID')->sortable(), TextColumn::make('title')->label('Название')->sortable()->searchable(), TextColumn::make('created_at')->label('Дата создания')->sortable(), ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListEventCategories::route('/'), 'create' => Pages\CreateEventCategory::route('/create'), 'edit' => Pages\EditEventCategory::route('/{record}/edit'), ]; } }