diff --git a/src/Illuminate/Http/Middleware/TrustHosts.php b/src/Illuminate/Http/Middleware/TrustHosts.php index 8b563151adc0..fd7e601518f0 100644 --- a/src/Illuminate/Http/Middleware/TrustHosts.php +++ b/src/Illuminate/Http/Middleware/TrustHosts.php @@ -55,7 +55,7 @@ public function handle(Request $request, $next) */ protected function shouldSpecifyTrustedHosts() { - return config('app.env') !== 'local' && + return ! $this->app->environment('local') && ! $this->app->runningUnitTests(); }