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
Create a ViewPage (extend ViewRecords) similar to EditPage, register it on the
Resource::getPages()
.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.
copy the default view and set it as the $view for your page
and then add whatever you want in there
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.
you can use the form builder or table builder on custom pages
thanks for help
The default ViewPage uses the form builder and renders the form with all inputs disabled.