mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:14:04 +00:00
* Add origin ID MW * Test origin ID MW * Test origin ID MW with early identification * Fix code style (php-cs-fixer) * Fix PHPStan errors * Add getDomain() to domain ID MW, simplify origin ID MW * Fix code style (php-cs-fixer) * Rename InitializeTenancyByOrigin to InitializeTenancyByOriginHeader * Add onFail test * Stop throwing the exception in getDomain() * FIx merge * Improve origin identification test file * Clean up test --------- Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
15 lines
303 B
PHP
15 lines
303 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Middleware;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
class InitializeTenancyByOriginHeader extends InitializeTenancyByDomainOrSubdomain
|
|
{
|
|
public function getDomain(Request $request): string
|
|
{
|
|
return $request->header('Origin', '');
|
|
}
|
|
}
|