diff --git a/assets/config.php b/assets/config.php index 891bc64c..b12cd6c4 100644 --- a/assets/config.php +++ b/assets/config.php @@ -168,6 +168,7 @@ return [ // Stancl\Tenancy\Features\UniversalRoutes::class, // Stancl\Tenancy\Features\TenantConfig::class, // https://tenancyforlaravel.com/docs/v3/features/tenant-config // Stancl\Tenancy\Features\CrossDomainRedirect::class, // https://tenancyforlaravel.com/docs/v3/features/cross-domain-redirect + // Stancl\Tenancy\Features\ViteBundler::class, ], /** diff --git a/src/Features/ViteBundler.php b/src/Features/ViteBundler.php new file mode 100644 index 00000000..76b96a48 --- /dev/null +++ b/src/Features/ViteBundler.php @@ -0,0 +1,21 @@ +app->singleton(FoundationVite::class, StanclVite::class); + } +} diff --git a/src/TenancyServiceProvider.php b/src/TenancyServiceProvider.php index 4faaccf3..dec8c72e 100644 --- a/src/TenancyServiceProvider.php +++ b/src/TenancyServiceProvider.php @@ -65,6 +65,7 @@ class TenancyServiceProvider extends ServiceProvider $this->app->singleton(Commands\Rollback::class, function ($app) { return new Commands\Rollback($app['migrator']); }); + $this->app->singleton(Commands\Seed::class, function ($app) { return new Commands\Seed($app['db']); }); diff --git a/src/Vite.php b/src/Vite.php new file mode 100644 index 00000000..2598a2e4 --- /dev/null +++ b/src/Vite.php @@ -0,0 +1,20 @@ +toBeInstanceOf(FoundationVite::class); + + expect($vite)->not->toBeInstanceOf(StanclVite::class); + + config([ + 'tenancy.features' => [ViteBundler::class], + ]); + + $tenant = Tenant::create(); + + tenancy()->initialize($tenant); + + app()->forgetInstance(\Illuminate\Foundation\Vite::class); + + $vite = app(\Illuminate\Foundation\Vite::class); + + expect($vite)->toBeInstanceOf(StanclVite::class); +});