Error while trying to adapt a v2 pattern to v3
We used this pattern to show multiple lists for the same resource in the navigation bar:
ListCustomers and all those other classes extend a UserList class, with different tables.
When I try to use this, i get a "Route [filament.admin.pages.list-customers] not defined.". I tried registering the classes in the getPages function of the UserResource, but when i do so, thei create a route under filament.admin.resource.list-customers, not filament.admin.pages.list-customers. If I edit the function "getRouteName" inside the Page function, it works as I would assume. What am I doing wrong? Why are they registered under resources instead of pages? how can I register the routes for this lists under the pages route?
5 Replies
Do you have Customers / Partners / Staff resources?
@pboivin No I extended the UserList page, avoiding creating 3 different resources that would all relate to the same Eloquent Model, which would be user
Ok, makes sense. If
ListCustomers
extends ListUsers
, it sounds like it should belong in the UserResource
, and count as a resource page. Am I understanding this correctly?Yes patrick, that would be the case, anyway I followed your first suggestion and created multiple resources linked to the model, as to have more granular control over the forms. Still, how would someone register a page in the filament.admin.page route/namespace?
I think custom pages (not resource pages) get assigned to the
filament.admin.page
route prefix