Basic navigation from row in "parent" list to table of "children"

Hi apologies if this is a fundamental PHP or Laravel question.

I have a table view of Properties. Properties have PropertyRooms.

(I have tinkered with "relation manager" and can see how to get to e.g.an Edit Property page which shows underneath the a CRUD table of PropertyRooms. It was good to see how this works but isn't the UX I am trying to implement.)

So in the image shown, I would like to click the "rooms" link and have it take me to the rooms for that property.

I am assuming I would use the
->url()
method but to be honest I cannot see what's required here and the purpose of the parameters passed. Not sure if I also need to define a route within my web.php (though I suspect not as I think they are defined elsewhere when using Filament - for example within the relevant <model_name>Resource.php file

So here's an excerpt of the code (copied in structure from example here https://filamentphp.com/docs/3.x/tables/actions)
 ->actions([
                Tables\Actions\EditAction::make(),

                Tables\Actions\Action::make('drilldown')
                ->label('Rooms')
                ->url(fn (MyProperty $record): string => route('property_rooms', $record))
                ->openUrlInNewTab()


Looking not for someone to necessarily give me the code but perhaps a link to where what's happening under the covers is explained would be really helpful.

many thanks in advance,
j
image.png
Was this page helpful?