diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 660a0f8a..a7fbe51c 100755 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -37,6 +37,7 @@ class Kernel extends HttpKernel 'api' => [ 'throttle:60,1', 'bindings', + 'json', ], ]; @@ -54,6 +55,7 @@ class Kernel extends HttpKernel 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'json' => \App\Http\Middleware\JsonResponse::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, #'role' => \Laratrust\Middleware\LaratrustRole::class, #'permission' => \Laratrust\Middleware\LaratrustPermission::class, diff --git a/app/Http/Middleware/JsonResponse.php b/app/Http/Middleware/JsonResponse.php new file mode 100644 index 00000000..5eb06262 --- /dev/null +++ b/app/Http/Middleware/JsonResponse.php @@ -0,0 +1,18 @@ +headers->set('Content-Type', 'application/json'); + return $response; + } +}