diff --git a/src/Middleware/PageSpeed.php b/src/Middleware/PageSpeed.php index 1f8240c..d3e4053 100644 --- a/src/Middleware/PageSpeed.php +++ b/src/Middleware/PageSpeed.php @@ -55,7 +55,7 @@ protected function replace(array $replace, $buffer) protected function isEnable() { $enable = config('laravel-page-speed.enable'); - return (is_null($enable))?true: (boolean) $enable ; + return (is_null($enable))?true: (boolean) $enable; } /** @@ -67,16 +67,13 @@ protected function isEnable() protected function shouldProcessPageSpeed($request) { $patterns = config('laravel-page-speed.skip'); + $patterns = (is_null($patterns))?[]: $patterns; if (! $this->isEnable()) { return false; } - if ( !is_array($patterns) ) { - return false; - } - - return collect($patterns)->every(function($pattern) use ($request){ + return collect($patterns)->every(function ($pattern) use ($request) { if (!$request->is($pattern)) { return true; }