© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Sythe

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:

            ->actions([
                Tables\Actions\Action::make('edit')->url(route('filament.admin.resources.modules.edit', ['record' => $record])),
                Tables\Actions\DeleteAction::make(),
            ])
            ->actions([
                Tables\Actions\Action::make('edit')->url(route('filament.admin.resources.modules.edit', ['record' => $record])),
                Tables\Actions\DeleteAction::make(),
            ])


But
$record
$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
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])),
Tables\Actions\Action::make('edit')->url(fn($record): string => route('filament.admin.resources.modules.edit', [$record->id])),
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Opening related resource in its own page
FilamentFFilament / ❓┊help
2y ago
Saving related items when editing/creating a resource
FilamentFFilament / ❓┊help
3y ago
create and attach related models when creating resource
FilamentFFilament / ❓┊help
3y ago
Modal resource editing
FilamentFFilament / ❓┊help
2y ago