Files
mtdb_movie/common/Core/BaseTrustHosts.php
maher 511fad8199
Build / run (push) Has been cancelled
Initial commit
2026-05-14 13:42:10 +02:00

27 lines
613 B
PHP
Executable File

<?php
namespace Common\Core;
use Common\Domains\CustomDomainController;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class BaseTrustHosts extends Middleware
{
public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
protected function shouldSpecifyTrustedHosts(): bool
{
// allow custom domain validation
if (request()->path() === CustomDomainController::VALIDATE_CUSTOM_DOMAIN_PATH) {
return false;
} else {
return parent::shouldSpecifyTrustedHosts();
}
}
}