Tricks

Relation Manager edit record using Resource page instead of modal

Jun 10, 2022
Abdallah Baddour
Admin panel

The default behavior of the Edit action in RelationManager is to edit the record in a modal, this behavior can be changed by redirecting to the edit resource page.

Let's say we have Products records being listed in Category Resource using ProductsRelationManager, we can override the EditAction as below:

use Filament\Tables\Actions\EditAction;
 
EditAction::make()
->url(fn (Model $record): string => ProductResource::getUrl('edit', $record))
avatar

Modified to work in V3:

EditAction::make()
->url(fn (Model $record): string => ProductResource::getUrl('edit', ['record' => $record]))