mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 09:54:03 +00:00
add cookie property
This commit is contained in:
parent
9eab5216b9
commit
0d7c52634a
2 changed files with 5 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ use Stancl\Tenancy\Tenancy;
|
|||
class InitializeTenancyByRequestData extends IdentificationMiddleware
|
||||
{
|
||||
public static string $header = 'X-Tenant';
|
||||
public static string $cookie = 'X-Tenant';
|
||||
public static string $queryParameter = 'tenant';
|
||||
public static ?Closure $onFail = null;
|
||||
|
||||
|
|
@ -41,8 +42,8 @@ class InitializeTenancyByRequestData extends IdentificationMiddleware
|
|||
return $request->get(static::$queryParameter);
|
||||
}
|
||||
|
||||
if (static::$header && $request->hasCookie(static::$header)) {
|
||||
return $request->cookie(static::$header);
|
||||
if (static::$cookie && $request->hasCookie(static::$cookie)) {
|
||||
return $request->cookie(static::$cookie);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue