bibrokhim/laravel-force-json-response
Laravel middleware that forces every request to accept JSON by setting the Accept header to application/json when missing or different, ensuring your app consistently returns JSON responses. Install via composer require bibrokhim/laravel-force-json-response.
This library checks the Accept header of each request. If the header is missing or has a value other than application/json, then the value will be set to application/json. This is enough for Laravel to return each response in JSON format.
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require bibrokhim/laravel-force-json-response
How can I help you explore Laravel packages today?