F
Filamentβ€’16mo ago
KiaBoluki

is it possible to make a filament resource based on scope ?

I am curious to know if it is possible to create different resources based on one model's scopes. For example, I have a Listing model with a type scope. Can I create a GameListingResource for Listings with a type of Game, and a GiftCardResource for Listings with a type of GiftCard? If yes, how can I do that? If no, any suggestions would be appreciated.
Solution:
Sure multiple resources can be created for the same model (as long as you set different slug)
Jump to solution
3 Replies
Solution
ZedoX
ZedoXβ€’16mo ago
Sure multiple resources can be created for the same model (as long as you set different slug)
ZedoX
ZedoXβ€’16mo ago
Just change the Eloquent Query on each resource to scope it to a type
KiaBoluki
KiaBolukiOPβ€’16mo ago
oh my god 😲 the slug was the solution. thank you so much . πŸ’
Want results from more Discord servers?
Add your server