schema([ Forms\Components\TextInput::make('title') ->label('Titre') ->required() ->maxLength(255), Forms\Components\TextInput::make('category') ->label('Catégorie') ->required() ->maxLength(255) ->default('Général'), Forms\Components\RichEditor::make('content') ->label('Contenu') ->required() ->columnSpanFull(), Forms\Components\FileUpload::make('image_url') ->label('Image') ->image() ->directory('informations'), Forms\Components\Toggle::make('is_published') ->label('Publié') ->default(true) ->required(), ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('title') ->label('Titre') ->searchable(), Tables\Columns\TextColumn::make('category') ->label('Catégorie') ->badge() ->searchable(), Tables\Columns\IconColumn::make('is_published') ->label('Publié') ->boolean(), Tables\Columns\TextColumn::make('created_at') ->label('Créé le') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ Tables\Filters\TernaryFilter::make('is_published') ->label('Statut de publication') ->boolean() ->trueLabel('Publiés') ->falseLabel('Brouillons') ->native(false), ]) ->actions([ Tables\Actions\EditAction::make(), Tables\Actions\DeleteAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getPages(): array { return [ 'index' => Pages\ListInformation::route('/'), 'create' => Pages\CreateInformation::route('/create'), 'edit' => Pages\EditInformation::route('/{record}/edit'), ]; } }