in v3, what's the best way to filter which resources are available in a panel?
Moved from https://discord.com/channels/883083792112300104/1131818368652025927
Continuing the chat, @zepfietje suggests to scope to the admin, like so "App/Filament/Resources/Admin/UserResource" ?
In my opinion, this is not really working out because sometimes we want to let other panel access UserResource, even though Yes, UserResource is specific to adminPanel
6 Replies
I am thinking to have something like ->exceptResources([App/Filament/Resources/UserResource::class])
. Thoughts?
and or we can have like
->onlyResources([...])
? This will overwrite the discoveries
the same with Pages, and widgetsYou can manually register resources: https://github.com/filamentphp/filament/blob/37726899f118db14ff8411f272891ccf7bfbfe87/packages/panels/src/Panel/Concerns/HasComponents.php#L77
There is, but, I think the
->discoversResources()
is required because it also calls the discoverComponents
?
happy to make a PR though, but would love to know the thinking right firstMaybe
should accept an array
Then we just need a Shared resource folder... i need that too
I like this idea
you can leave your
->discoverResources()
as is, and chain with ->resources(['UserResource'])
, that's another option