diff --git a/Clockwork/Request/IncomingRequest.php b/Clockwork/Request/IncomingRequest.php index 96388495..865a934f 100644 --- a/Clockwork/Request/IncomingRequest.php +++ b/Clockwork/Request/IncomingRequest.php @@ -41,8 +41,10 @@ public function hasLocalHost() { $segments = explode('.', $this->host); $tld = $segments[count($segments) - 1]; + $local_domains = config('clockwork.local_domains') ?? ['localhost', 'locl', 'local', 'test', 'wip']; + + return $this->host == '127.0.0.1' || + in_array($tld, $local_domains); - return $this->host == '127.0.0.1' - || in_array($tld, [ 'localhost', 'local', 'test', 'wip' ]); } } diff --git a/Clockwork/Support/Laravel/config/clockwork.php b/Clockwork/Support/Laravel/config/clockwork.php index 6f0a6479..0cdfc89f 100644 --- a/Clockwork/Support/Laravel/config/clockwork.php +++ b/Clockwork/Support/Laravel/config/clockwork.php @@ -15,6 +15,18 @@ 'enable' => env('CLOCKWORK_ENABLE', null), + /* + |------------------------------------------------------------------------------------------------------------------ + | Local Domains + |------------------------------------------------------------------------------------------------------------------ + | + | Here you can specify the domains that Clockwork considers as "local". Clockwork will only run on these domains + | unless explicitly enabled. + | + */ + + 'local_domains' => ['localhost', 'locl', 'local', 'test', 'wip'], + /* |------------------------------------------------------------------------------------------------------------------ | Features