schema([ Forms\Components\TextInput::make('nome')->label('Nome')->required(), Forms\Components\TextInput::make('cognome')->label('Cognome'), Forms\Components\TextInput::make('ragione_sociale')->label('Ragione sociale'), Forms\Components\TextInput::make('email')->label('Email')->email()->required(), Forms\Components\TextInput::make('telefono')->label('Telefono')->tel(), Forms\Components\TextInput::make('indirizzo')->label('Indirizzo'), Forms\Components\TextInput::make('cap')->label('CAP')->maxLength(10), Forms\Components\TextInput::make('citta')->label('Città'), Forms\Components\TextInput::make('provincia')->label('Provincia')->maxLength(5), Forms\Components\Textarea::make('note')->label('Note')->columnSpanFull(), ]); } public static function table(Table $table): Table { return $table ->defaultSort('created_at', 'desc') ->columns([ Tables\Columns\TextColumn::make('nominativo')->label('Nominativo')->searchable(['nome', 'cognome', 'ragione_sociale']), Tables\Columns\TextColumn::make('email')->label('Email')->searchable()->copyable(), Tables\Columns\TextColumn::make('telefono')->label('Telefono')->placeholder('—'), Tables\Columns\TextColumn::make('citta')->label('Città')->placeholder('—'), Tables\Columns\TextColumn::make('preventivi_count')->label('Preventivi')->counts('preventivi'), Tables\Columns\TextColumn::make('created_at')->label('Registrato')->dateTime('d/m/Y')->sortable(), ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getPages(): array { return [ 'index' => Pages\ListClientes::route('/'), 'edit' => Pages\EditCliente::route('/{record}/edit'), ]; } }