Closed DanTheDJ closed 7 years ago
By checking the value of domain in the function resolveRequest()
you can either assign tenant to null or to the value from the database:
$domain = (new ArgvInput())->getParameterOption('--tenant', null);
try
{
$model = $this->tenant;
(is_null($domain) ? $tenant = null : $tenant = $model->where('subdomain', '=', $domain)->orWhere('alias_domain', '=', $domain)->orWhere('id', '=', $domain)->first());
}
catch (\Exception $e)
{
$tenant = null;
echo $e->getMessage();
}
When the command
php artisan migrate --path /vendor/danthedj/multitenant/migrations
is run, an error is displayed:This error occurs due to the TenantResolver trying to resolve a domain of null.