[CrossDomainRedirect::class], ]); Route::get('/foobar', function () { return 'Foo'; })->name('home'); Route::get('/redirect', function () { return redirect()->route('home')->domain('abcd'); }); $tenant = Tenant::create(); tenancy()->initialize($tenant); $this->get('/redirect') ->assertRedirect('http://abcd/foobar'); } #[Test] public function tenant_route_helper_generates_correct_url() { Route::get('/abcdef/{a?}/{b?}', function () { return 'Foo'; })->name('foo'); $this->assertSame('http://foo.localhost/abcdef/as/df', tenant_route('foo.localhost', 'foo', ['a' => 'as', 'b' => 'df'])); $this->assertSame('http://foo.localhost/abcdef', tenant_route('foo.localhost', 'foo', [])); } }