schema([ Forms\Components\TextInput::make('title') ->required() ->maxLength(255) ->reactive() ->afterStateUpdated(fn (string $operation, $state, Forms\Set $set) => $operation === 'create' ? $set('slug', Str::slug($state)) : null) ->debounce('1000ms'), Forms\Components\TextInput::make('slug') ->required() ->maxLength(255), Forms\Components\TextInput::make('title_description') ->maxLength(255) ->required() ->columnSpanFull(), Forms\Components\Repeater::make('bullets') ->schema([ Forms\Components\TextInput::make('bullet') ->label('Bullet Point') ->required(), ]) ->columns(1) ->columnSpanFull() ->createItemButtonLabel('Add Bullet Point') ->defaultItems(1), Forms\Components\Repeater::make('downloads') ->schema([ Forms\Components\TextInput::make('title') ->label('Download Title') ->required(false), Forms\Components\FileUpload::make('file') ->label('Download File') ->required(false) ->disk('public') ->directory('solution-downloads'), ]) ->columns(1) ->columnSpanFull() ->createItemButtonLabel('Add Download Item') ->defaultItems(1), Forms\Components\Repeater::make('faqs') ->schema([ Forms\Components\TextInput::make('question') ->label('Question') ->required(), Forms\Components\RichEditor::make('answer') ->label('Answer') ->required(), ]) ->columns(1) ->columnSpanFull() ->createItemButtonLabel('Add FAQ') ->defaultItems(1), Forms\Components\RichEditor::make('description') ->required() ->columnSpanFull(), ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('title') ->searchable(), Tables\Columns\TextColumn::make('slug') ->searchable(), Tables\Columns\TextColumn::make('created_at') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->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\ListSolutions::route('/'), 'create' => Pages\CreateSolution::route('/create'), 'edit' => Pages\EditSolution::route('/{record}/edit'), ]; } public static function canViewAny(): bool { return auth()->user()->role === UserRole::ADMIN || auth()->user()->role === UserRole::MANAGER; } }