mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 14:34:04 +00:00
wip
This commit is contained in:
parent
c0d0dc99de
commit
4c20e30fcc
4 changed files with 13 additions and 3 deletions
|
|
@ -283,6 +283,9 @@ return [
|
|||
// Stancl\Tenancy\Features\TelescopeTags::class,
|
||||
// Stancl\Tenancy\Features\UniversalRoutes::class,
|
||||
// Stancl\Tenancy\Features\TenantConfig::class, // https://tenancyforlaravel.com/docs/v3/features/tenant-config
|
||||
],
|
||||
|
||||
'tenant_unaware_features' => [
|
||||
// Stancl\Tenancy\Features\CrossDomainRedirect::class, // https://tenancyforlaravel.com/docs/v3/features/cross-domain-redirect
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Route as Router;
|
|||
use Stancl\Tenancy\Contracts\Feature;
|
||||
use Stancl\Tenancy\Middleware;
|
||||
|
||||
// todo this got deleted in v4.
|
||||
class UniversalRoutes implements Feature
|
||||
{
|
||||
public static string $middlewareGroup = 'universal';
|
||||
|
|
|
|||
|
|
@ -27,7 +27,13 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
// Make sure Tenancy is stateful.
|
||||
$this->app->singleton(Tenancy::class);
|
||||
|
||||
foreach ($this->app['config']['tenancy.features'] ?? [] as $feature) {
|
||||
$this->app->resolving(Tenancy::class, function (Tenancy $tenancy, $app) {
|
||||
foreach ($this->app['config']['tenancy.features'] ?? [] as $feature) {
|
||||
$this->app[$feature]->bootstrap();
|
||||
}
|
||||
});
|
||||
|
||||
foreach ($this->app['config']['tenancy.tenant_unaware_features'] ?? [] as $feature) {
|
||||
$this->app[$feature]->bootstrap();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use Stancl\Tenancy\Tests\Etc\Tenant;
|
|||
|
||||
test('tenant redirect macro replaces only the hostname', function () {
|
||||
config([
|
||||
'tenancy.features' => [CrossDomainRedirect::class],
|
||||
'tenancy.tenant_unaware_features' => [CrossDomainRedirect::class],
|
||||
]);
|
||||
|
||||
Route::get('/foobar', function () {
|
||||
|
|
@ -37,7 +37,7 @@ test('tenant route helper generates correct url', function () {
|
|||
|
||||
test('redirect from central to tenant works fine', function () {
|
||||
config([
|
||||
'tenancy.features' => [CrossDomainRedirect::class],
|
||||
'tenancy.tenant_unaware_features' => [CrossDomainRedirect::class],
|
||||
]);
|
||||
|
||||
Route::get('/foobar', function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue