andreishevchuk / header-accept-json
The middleware wich set global accept header as application/json for Laravel.
v1.0
2020-10-25 19:41 UTC
Requires
- php: >=7.2
- illuminate/http: ^5.8 || ^6.0 || ^7.0 || ^8.0
This package is auto-updated.
Last update: 2025-04-26 05:09:12 UTC
README
The middleware which set global accept header as application/json for Laravel.
Install
Composer command:
composer require andreishevchuk/header-accept-json
Add to config/app.php:
'providers' => [ ..., \Andreishevchuk\HeaderAcceptJson\HeaderAcceptJsonServiceProvider::class, ... ];
Artisan command:
php artisan vendor:publish --provider="Andreishevchuk\HeaderAcceptJson\HeaderAcceptJsonServiceProvider" --tag="middleware"
Add to app/Http/Karnel.php:
protected $middleware = [ ..., \App\Http\Middleware\HeaderAcceptJson::class, ... ];