I have a project where I need to implement multitenancy with multi-databases.
I have gone through the installation process, and created a domain for my tenant, but everytime I try to access it I get this error:
Call to undefined method Stancl\Tenancy\Database\Models\Tenant::domains()
The domains function is found on a trait called HasDomains, but I cannot figure it out why Laravel cannot resolve it.
Here's my model:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\Database\Concerns\HasDatabase;
use Stancl\Tenancy\Database\Concerns\HasDomains;
use Stancl\Tenancy\Database\Models\Tenant as ModelsTenant;
class Tenant extends ModelsTenant implements TenantWithDatabase
{
use HasFactory;
use HasDatabase;
use HasDomains;
}
Any ideas?