© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
alexanderkroneis

Child Relationship of Tenant Model

Hi, I am currently working on a simple tenancy application. The tenant has some relationships, e.g.
customers
customers
or
users
users
. The Customer model has a relation to
projects
projects
. I can't figure out, how to implement this child-relationship to Tenant.

That's my current approach
class ProjectResource extends Resource
{
    protected static ?string $model = Project::class;

    protected static ?string $tenantOwnershipRelationshipName = 'customer';
    protected static ?string $tenantRelationshipName = 'customer';
class ProjectResource extends Resource
{
    protected static ?string $model = Project::class;

    protected static ?string $tenantOwnershipRelationshipName = 'customer';
    protected static ?string $tenantRelationshipName = 'customer';


which gives me the following error:
The model [App\Models\Team] does not have a relationship named [customer]. You can change the relationship being used by setting it as the [$tenantRelationshipName] static property on the [App\Filament\App\Resources\ProjectResource] resource class.
The model [App\Models\Team] does not have a relationship named [customer]. You can change the relationship being used by setting it as the [$tenantRelationshipName] static property on the [App\Filament\App\Resources\ProjectResource] resource class.


Which is a valid error. But how can I instruct Filament to go into the customer model and look for the tenant over there?
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

Display link of child relationship
FilamentFFilament / ❓┊help
3y ago
Define multi-tenant relationship indirectly through another model
FilamentFFilament / ❓┊help
9mo ago
Get ID of parent model when making a child model using Relationship Manager via the modal
FilamentFFilament / ❓┊help
2y ago
Multi-Tenancy HasManyThrough Tenant Relationship
FilamentFFilament / ❓┊help
3y ago