Editing related models in their own Resource
I have a RelationManager in a Resource. The relation also has it's own resource, but I use the RelationManager for convienience, so it's easy to see which records are nested inside a model.
Now I want the EditAction to redirect to it's own Resource page. I do it like this:
But
$record
is not the right variable. I tried several things, but I can't find the solution.
Two questions:
- Is this the right way to do, or is there a simpler solution?
- What is the right variable?Solution:Jump to solution
Sorry, for posting, but this was the answer:
Tables\Actions\Action::make('edit')->url(fn($record): string => route('filament.admin.resources.modules.edit', [$record->id])),
...1 Reply
Solution
Sorry, for posting, but this was the answer:
Tables\Actions\Action::make('edit')->url(fn($record): string => route('filament.admin.resources.modules.edit', [$record->id])),