diff --git a/src/Middleware/ApiHeaderInject.php b/src/Middleware/ApiHeaderInject.php index 3178399..5722f84 100644 --- a/src/Middleware/ApiHeaderInject.php +++ b/src/Middleware/ApiHeaderInject.php @@ -1,26 +1,27 @@ headers->add([ 'Accept'=>'application/json', - 'Content-Type'=>'application/json' + 'Content-Type'=>'application/json', ]); } - if(config('laravel-api-generator.allow_cross_origin')) { + if (config('laravel-api-generator.allow_cross_origin')) { $request->headers->add([ 'Access-Control-Allow-Origin' => '*', - 'Access-Control-Allow-Methods' => 'GET, POST, PUT, DELETE, OPTIONS' + 'Access-Control-Allow-Methods' => 'GET, POST, PUT, DELETE, OPTIONS', ]); } + return $next($request); } }