FilamentF
Filament2y ago
CT

How to keep both modal Edit action and generate an edit route url?

I have a client who specifically needs both the edit modal and the edit link itself to work (ie modal opens from all table cells), but also needs from other pages a working link to the edit page, ie /{record}/edit should be a valid url.
I can get either one working fine, but the problem is as follows:
public static function getPages(): array
    {
        return [
            'index' => Pages\ListSites::route('/'),
            'create' => Pages\CreateSite::route('/create'),
            'edit' => Pages\EditSite::route('/{record}/edit'),
        ];
    }

When
edit
is commented modal works, but there is no edit route generated (verified with php artisan route:list)
When
edit
is uncommented there is no modal but the edit route is correctly generated.

Anyone tackled something like this before? Thanks
Was this page helpful?