[ 'localhost', ], ]); Route::middleware(InitializeTenancyByRequestOrigin::class)->get('/test', function () { return 'Tenant id: ' . tenant('id'); }); } /** @test */ public function origin_identification_works() { $tenant = Tenant::create(); $tenant->domains()->create([ 'domain' => 'localhost' ]); $this ->withoutExceptionHandling() ->get('test', [ 'Origin' => 'http://localhost', ]) ->assertSee($tenant->id); } }