diff --git a/app/Filament/Resources/SantoResource.php b/app/Filament/Resources/SantoResource.php index 3295c1b..b01402c 100644 --- a/app/Filament/Resources/SantoResource.php +++ b/app/Filament/Resources/SantoResource.php @@ -92,7 +92,16 @@ public static function table(Table $table): Table public static function getPages(): array { return [ - 'index' => Pages\ManageSanti::route('/'), + 'index' => Pages\ListSanti::route('/'), + 'create' => Pages\CreateSanto::route('/create'), + 'edit' => Pages\EditSanto::route('/{record}/edit'), + ]; + } + + public static function getRelations(): array + { + return [ + RelationManagers\SegnalazioniRelationManager::class, ]; } } diff --git a/app/Filament/Resources/SantoResource/Pages/CreateSanto.php b/app/Filament/Resources/SantoResource/Pages/CreateSanto.php new file mode 100644 index 0000000..29691e9 --- /dev/null +++ b/app/Filament/Resources/SantoResource/Pages/CreateSanto.php @@ -0,0 +1,11 @@ +schema([ + Forms\Components\TextInput::make('testo_segnalazione') + ->required() + ->maxLength(255), + ]); + } + + public function table(Table $table): Table + { + return $table + ->recordTitleAttribute('testo_segnalazione') + ->columns([ + Tables\Columns\TextColumn::make('testo_segnalazione'), + ]) + ->filters([ + // + ]) + ->headerActions([ + Tables\Actions\CreateAction::make(), + ]) + ->actions([ + Tables\Actions\EditAction::make(), + Tables\Actions\DeleteAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } +} diff --git a/app/Filament/Resources/UserResource.php b/app/Filament/Resources/UserResource.php index 92ce829..74dd561 100644 --- a/app/Filament/Resources/UserResource.php +++ b/app/Filament/Resources/UserResource.php @@ -5,13 +5,10 @@ use App\Filament\Resources\UserResource\Pages; use App\Filament\Resources\UserResource\RelationManagers; use App\Models\User; -use Filament\Forms; use Filament\Forms\Form; use Filament\Resources\Resource; use Filament\Tables; use Filament\Tables\Table; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Eloquent\SoftDeletingScope; class UserResource extends Resource { @@ -62,9 +59,9 @@ public static function getRelations(): array public static function getPages(): array { return [ - 'index' => Pages\ListUsers::route('/'), - 'create' => Pages\CreateUser::route('/create'), - 'edit' => Pages\EditUser::route('/{record}/edit'), + 'index' => SantoResource\Pages\ListSanti::route('/'), + 'create' => SantoResource\Pages\CreateSanto::route('/create'), + 'edit' => SantoResource\Pages\EditSanto::route('/{record}/edit'), ]; } diff --git a/package-lock.json b/package-lock.json index 48cd9af..b1ace0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -917,9 +917,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001625", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001625.tgz", - "integrity": "sha512-4KE9N2gcRH+HQhpeiRZXd+1niLB/XNLAhSy4z7fI8EzcbcPoAqjNInxVHTiTwWfTIV4w096XG8OtCOCQQKPv3w==", + "version": "1.0.30001627", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001627.tgz", + "integrity": "sha512-4zgNiB8nTyV/tHhwZrFs88ryjls/lHiqFhrxCW4qSTeuRByBVnPYpDInchOIySWknznucaf31Z4KYqjfbrecVw==", "dev": true, "funding": [ { @@ -2429,9 +2429,9 @@ } }, "node_modules/yaml": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", - "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.3.tgz", + "integrity": "sha512-sntgmxj8o7DE7g/Qi60cqpLBA3HG3STcDA0kO+WfB05jEKhZMbY7umNm2rBpQvsmZ16/lPXCJGW2672dgOUkrg==", "dev": true, "bin": { "yaml": "bin.mjs"