How to use View pages?

Hello guys, I would like to show table of related models and their attributes in View page of resource (Main model). How is this achieved?
7 Replies
Dennis Koch
Dennis Koch2y ago
Create a ViewPage (extend ViewRecords) similar to EditPage, register it on the Resource::getPages().
Padrezz
PadrezzOP2y ago
This part I get, but I'm still not getting where I'm "sending content or creating table etc". Methods in ViewRecord are not making sennce to me. Should I copy default view and override it? Or is they way how to insert just table? https://filamentphp.com/docs/2.x/admin/resources/viewing-records
Filament
Viewing records - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
Dan Harrin
Dan Harrin2y ago
copy the default view and set it as the $view for your page and then add whatever you want in there
Padrezz
PadrezzOP2y ago
Ok, so there isn't something like when you are creating form? Chaining functions with data what renders components Basically in my case, i need to render table there which will be list of childs.
Dan Harrin
Dan Harrin2y ago
you can use the form builder or table builder on custom pages
Padrezz
PadrezzOP2y ago
thanks for help
Dennis Koch
Dennis Koch2y ago
The default ViewPage uses the form builder and renders the form with all inputs disabled.
Want results from more Discord servers?
Add your server