© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
thyk123

is it possible to get model name inside resource?

is it possible to get model name inside resource? i want to get model name and query it like this
(fn (Builder $query) => $query->where('type', $modelName/$resourcesName)->where('deleted_at',)),
(fn (Builder $query) => $query->where('type', $modelName/$resourcesName)->where('deleted_at',)),

Is that possible? thank you!
Solution
you can use
static::getModel()
static::getModel()

and it will return the class
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Call another model inside repeater, it is possible?
FilamentFFilament / ❓┊help
2y ago
How to translate Resource model name?
FilamentFFilament / ❓┊help
3y ago
Is it not possible to have 2 forms inside a resource form?
FilamentFFilament / ❓┊help
2y ago
get resource page name
FilamentFFilament / ❓┊help
13mo ago