Multi Tenancy with one to many polymorphic relationship.

I got the error. I can't create the category at the filament panel
The model [App\Models\Tenant] does not have a relationship named [categories]. You can change the relationship being used by setting it as the [$tenantRelationshipName] static property on the [App\Filament\Resources\CategoryResource] resource class.
The model [App\Models\Tenant] does not have a relationship named [categories]. You can change the relationship being used by setting it as the [$tenantRelationshipName] static property on the [App\Filament\Resources\CategoryResource] resource class.
$panel->tenant(Tenant::class, ownershipRelationship: 'tenants')
$panel->tenant(Tenant::class, ownershipRelationship: 'tenants')
4 Replies
Lara Zeus
Lara Zeus2mo ago
add the relation categories to the tenant model
Shaung Bhone
Shaung Bhone2mo ago
Yes, error guide me like to do that. But it's one to many ploymorphic relationship. I don't need reverse relationship. Maybe I'm not sure. Let me check
Shaung Bhone
Shaung Bhone2mo ago
This is factory data.
No description
Shaung Bhone
Shaung Bhone2mo ago
stucking
Want results from more Discord servers?
Add your server