mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:44:04 +00:00
Make central route 404 in PreventAccess mw customizable
This commit is contained in:
parent
e363456497
commit
8e1cfa5ae0
1 changed files with 11 additions and 1 deletions
|
|
@ -13,6 +13,16 @@ use Illuminate\Support\Facades\Route as Router;
|
||||||
*/
|
*/
|
||||||
class PreventAccessFromTenantDomains
|
class PreventAccessFromTenantDomains
|
||||||
{
|
{
|
||||||
|
/** @var callable */
|
||||||
|
protected $central404;
|
||||||
|
|
||||||
|
public function __construct(callable $central404 = null)
|
||||||
|
{
|
||||||
|
$this->central404 = $central404 ?? function () {
|
||||||
|
return 404;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
|
|
@ -39,7 +49,7 @@ class PreventAccessFromTenantDomains
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isExemptDomain && $isTenantRoute) { // accessing tenant routes on web domains
|
if ($isExemptDomain && $isTenantRoute) { // accessing tenant routes on web domains
|
||||||
abort(404);
|
return ($this->central404)($request, $next);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue