mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 10:24:03 +00:00
Make TenancyUrlGenerator inherit the original UrlGenerator's scheme
This commit is contained in:
parent
f6a54defe6
commit
0bf7c10f0e
1 changed files with 5 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
||||||
use Stancl\Tenancy\Contracts\Tenant;
|
use Stancl\Tenancy\Contracts\Tenant;
|
||||||
use Stancl\Tenancy\Overrides\TenancyUrlGenerator;
|
use Stancl\Tenancy\Overrides\TenancyUrlGenerator;
|
||||||
use Stancl\Tenancy\Resolvers\PathTenantResolver;
|
use Stancl\Tenancy\Resolvers\PathTenantResolver;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes the app use TenancyUrlGenerator (instead of Illuminate\Routing\UrlGenerator) which:
|
* Makes the app use TenancyUrlGenerator (instead of Illuminate\Routing\UrlGenerator) which:
|
||||||
|
|
@ -78,6 +79,10 @@ class UrlGeneratorBootstrapper implements TenancyBootstrapper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inherit scheme (http/https) from the original generator
|
||||||
|
$originalScheme = Str::before($this->originalUrlGenerator->formatScheme(), '://');
|
||||||
|
$newGenerator->forceScheme($originalScheme);
|
||||||
|
|
||||||
$newGenerator->defaults($defaultParameters);
|
$newGenerator->defaults($defaultParameters);
|
||||||
|
|
||||||
$newGenerator->setSessionResolver(function () {
|
$newGenerator->setSessionResolver(function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue