Opening related resource in its own page
Hi! New filament user here.
Issue:
I have a SoftwareResource and a SoftwareVersionResource. Relation is Software hasMany SoftwareVersions. I want the SoftwareRelations Manager table on the SoftwareResource to open the related model (SoftwareVersions) in its own page but it opens it in a modal.
What I tried:
Added a View action in the relations manager
Error:
No error. Just unaware how to do it.
10 Replies
Currently Filament doesn't support nested resources. There are some plugins that try to solve this like: #guava-nested-resourcesI think V4 will add support for it
@Dennis Koch Thanks! I don't think mine is a case of nested resources. I have a Software Resource which hasMany SoftwareVersions. My issue is at the UI level, where adding a relationManager as a table will list out the SoftwareVersions on the Software page but clicking it only shows SoftwareVersion info in a modal and not in its own page
That’s exactly what nested resources are. Another edit page nested under the first edit page instead of a modal.
You could also overwrite the EditAction on the relation manager to just link to your software version but then you loose the hierarchy
I don't require them on the edit page but rather on the view page. Here's the actual thing.
On clicking on the "version" it shows the details in a modal. I just need it to open in a new page. Plugin hasMany Versions
you can try this @vipul on your case you will have to change the recordUrl action of your table.
This look like the thing to do. Surprising why we can't easily switch between modal and view page like it is done in resources quite easily.
Thanks a lot!
It's not that commong as you think, because you lose the hierarchy.
Can't you just add
->url(YourResource::getUrl('create')
to the action? Not sure what's harder about this than in resources?Yeah. I udnerstand the point on losing the hierarchy. Maybe i can make the modal much larger to accommodate more data while staying withn the page (https://github.com/filamentphp/filament/discussions/5468) or lose the hierarchy and go to the url anyway.
GitHub
Setting custom width for modal · filamentphp filament · Discussion ...
There is an undocumented method modalWidth() for actions. By default a modal is rather narrow as it usually prompts a simple dialog. But how to set a custom width for a modal when I need a more com...
This solves it I think
Thanks @Dennis Koch and @kingjaypee12