Open endikainchaurtieta opened 1 week ago
Hello @endikainchaurtieta, apologies for the delay, but I was quite severely ill last week.
Did you manage to solve this? That particular error is thrown by the following code:
if (
! class_exists($config['model'])
|| ! is_subclass_of($config['model'], Model::class)
|| ! is_subclass_of($config['model'], Tenant::class)
) {
throw MisconfigurationException::invalidConfig('model', 'provider', $name);
}
Which means that the exception is only thrown if one of the following conditions isn't met.
Illuminate\Database\Eloquent\Model
class.Sprout\Contracts\Tenant
, either directly or indirectly.From what you've provided, I don't see why that wouldn't be the case, but the only way I can recreate this locally is if I force one of those conditions to not be met.
First of all, congratulations on the 1.0-alpha release! This project shows a lot of potential, and I truly appreciate the effort you’ve put into it.
I’ve been experimenting with it and encountered an error I can’t seem to resolve. I’ve installed the package and configured it for subdomain tenancy with an Eloquent model. Here’s my
multitenancy.php
configuration file:My tenant model looks like this:
Then, I've set up the route like this:
Then when I try to access let's say, example.tenancy.test/login I get this error, I've traced and it's being raised by the
createEloquentProvider
function. The db has a record with the tenant, and I've also tried to add thegetTenantKeyName
and thegetTenantIdentifierName
but doesn't work, probably because I'm doing something wrong.Appreciate if you can give me a hand here to keep playing with it, thanks!