© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
2 replies
Rian

Multiple resources using same model not working

Hello!

I've got a
User
User
model, with an attribute
usertype
usertype
, values 1=Admin, 2=User, 3=Worker. This works, initially I had a single resource to manage these. I've been trying to split it into separate resources, i.e.: AdministratorResource, UserResource, and WorkerResource. However, no matter what I change or try all three of the resources end up showing the users. I've tried creating a separate Administrator model, I've added an override for the EloquentQuery:

public static function getEloquentQuery(): Builder
    {
        return parent::getEloquentQuery()->withoutGlobalScopes()->with(['usertype' => UserType::Administrator]);
    }
public static function getEloquentQuery(): Builder
    {
        return parent::getEloquentQuery()->withoutGlobalScopes()->with(['usertype' => UserType::Administrator]);
    }


As well as in the table function:

public static function table(Table $table): Table
    {
        return $table
            ->modifyQueryUsing(fn (Builder $query) => $query->where('usertype', [UserType::Administrator->value]))
            ->columns([
......
public static function table(Table $table): Table
    {
        return $table
            ->modifyQueryUsing(fn (Builder $query) => $query->where('usertype', [UserType::Administrator->value]))
            ->columns([
......


No matter what I try, change, or do, all three of my resources show the same, breadcrumbs also show
Users > list
Users > list
, rather than the relevant info from the resource I'm trying to view.

At this point I have:

UserResource -> User::class
WorkerResource -> User::class
AdministratorResource -> Administrator::class
UserResource -> User::class
WorkerResource -> User::class
AdministratorResource -> Administrator::class


Where
Administrator
Administrator
extends the
User
User
model, it was just an attempt to provide the resource with a different model.

What am I doing wrong?
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

Using same model for multiple resources
FilamentFFilament / ❓┊help
16mo ago
same model policy: multiple resources
FilamentFFilament / ❓┊help
2y ago
multiple resources based on same model
FilamentFFilament / ❓┊help
2y ago
Multiple Resources per Model
FilamentFFilament / ❓┊help
2y ago