Filament 3 custom view page for relation manager class
Hi,
I searched for a couple of hours and I still can't find information about how to create a custom page view, or just a view page, instead of a model view on a relation in Filament 3. I have created a resource and a relation (table under a resource record), but the only option is to create a modal view. I need a full page view.
Can you help me or at least give me some tips? Can I use infolist() and getPages() methods in a RelationManager? Maybe I need to call some Action class, create a custom view and custom route,or is there a terminal command that allows creating a full page view for a RelationManager?
Thanks!
19 Replies
If I understand correctly you want a view page for the record in the relation manager? Just like resources have?
yes, but for relation manager. Relation manager has only modal, not a view page
But it's still a table so I wonder does this work? https://filamentphp.com/docs/3.x/tables/advanced#record-urls-clickable-rows
i dont really understand, how it is working. relationManager table beggining: , route: and finally custom page: with view: , i am receving error: Unable to resolve dependency [Parameter #0 [ <required> string|int $record ]] in class App\Filament\Resources\LearningCategoryResource\Pages\ViewCustomLearningResource
i wanted to create a button named view (with icon) to have a behavior like a make filament resource --view parameter, which will create view with getPages() route, i can write a function getPages() with all necessary routes but i dont know how to connect Actions like ViewAction to the getPages() function. Maybe you know how to do that?
why are you creating a route for custom filament page?
or maybe i need to go outside of filament available functionallity and create route, controller and so on
because if i wont create a route it will show me an error that this route doesnt exists
filament creates route automatically
wait a minute, i will try again
case 3
yea, if i remove route form web.php it will give me an error, error: Route [resource.view] not defined.
filament doesn't name routes like that...
access route by calling
getUrl()
method on your page classif you can, we can go to call for 5 minutes
no
table beginning: and getPages(): , i thought that i did everything correctly but it says that "Expected type 'array'. Found 'string'" error is in table beginning
something off about what you do.
getPages()
is in a resource?no, it is in a relationManager, i need to make custom view page (not a modal, by default it is a modal for relationManag) for a relationManager. Do i still need to put custom view page in a resource?
you only create a custom page and call it in the table
i can put a custom page in a parent resource but how to call it from relation?