mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 08:24:05 +00:00
Fix tests
This commit is contained in:
parent
0dd9c3f9f0
commit
a1e9102ec6
3 changed files with 9 additions and 5 deletions
|
|
@ -28,6 +28,8 @@ class InitializeTenancy
|
|||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (tenancy()->initialized) return $next($request);
|
||||
|
||||
if (! in_array($request->getHost(), config('tenancy.exempt_domains', []), true)) {
|
||||
try {
|
||||
tenancy()->init($request->getHost());
|
||||
|
|
|
|||
|
|
@ -78,8 +78,6 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
__DIR__ . '/../assets/migrations/' => database_path('migrations'),
|
||||
], 'migrations');
|
||||
|
||||
$this->loadRoutesFrom(__DIR__ . '/routes.php');
|
||||
|
||||
$this->app->make(Kernel::class)->prependMiddleware(Middleware\InitializeTenancy::class);
|
||||
|
||||
/*
|
||||
|
|
@ -92,6 +90,8 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
Middleware\PreventAccessFromTenantDomains::class,
|
||||
]);
|
||||
|
||||
$this->loadRoutesFrom(__DIR__ . '/routes.php');
|
||||
|
||||
$this->app->singleton('globalUrl', function ($app) {
|
||||
if ($app->bound(FilesystemTenancyBootstrapper::class)) {
|
||||
$instance = clone $app['url'];
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
Route::middleware(['tenancy'])->group(function () {
|
||||
Route::get('/tenancy/assets/{path}', 'Stancl\Tenancy\Controllers\TenantAssetsController@asset')
|
||||
->where('path', '(.*)')
|
||||
->name('stancl.tenancy.asset');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue