mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:14:04 +00:00
Add exempt domains
This commit is contained in:
parent
eaeeeb5046
commit
7b95a9a4cd
2 changed files with 11 additions and 2 deletions
|
|
@ -8,7 +8,9 @@ class InitializeTenancy
|
|||
{
|
||||
public function __construct(Closure $onFail = null)
|
||||
{
|
||||
$this->onFail = $onFail ?: function ($e) { throw $e; };
|
||||
$this->onFail = $onFail ?: function ($e) {
|
||||
throw $e;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -20,6 +22,10 @@ class InitializeTenancy
|
|||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (in_array($request->getHost(), config('tenancy.exempt_domains', []))) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
try {
|
||||
tenancy()->init();
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
return [
|
||||
'storage_driver' => 'Stancl\Tenancy\StorageDrivers\RedisStorageDriver',
|
||||
'exempt_domains' => [
|
||||
// 'localhost',
|
||||
],
|
||||
'database' => [
|
||||
'based_on' => 'mysql',
|
||||
'prefix' => 'tenant',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue