bibrokhim/laravel-force-json-response

Force JSON response for every request

Maintainers

Package info

github.com/bibrokhim/laravel-force-json-response

Type:laravel-package

pkg:composer/bibrokhim/laravel-force-json-response

Statistics

Installs: 576

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2023-08-03 09:41 UTC

This package is auto-updated.

Last update: 2026-03-01 00:42:40 UTC


README

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