Download the PHP package softonic/laravel-request-accept-json-middleware without Composer
On this page you can find all versions of the php package softonic/laravel-request-accept-json-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download softonic/laravel-request-accept-json-middleware
More information about softonic/laravel-request-accept-json-middleware
Files in softonic/laravel-request-accept-json-middleware
Package laravel-request-accept-json-middleware
Short Description Laravel middleware to add Accept application/json header to requests
License Apache-2.0
Homepage https://github.com/softonic/laravel-request-accept-json-middleware
Informations about the package laravel-request-accept-json-middleware
Laravel request accept json middleware
This middleware adds the ability to automatically add the Accept application/json header to every request if it was not provided.
Requirements
- PHP >= 8.5
- Laravel 12.x
Installation
Via composer:
Documentation
To use the middleware register it in app/Http/Kernel.php
From now on the header Accept: application/json will be automatically added to every request.
Testing
softonic/laravel-request-accept-json-middleware has a PHPUnit test suite, code style compliance check using PHP CS Fixer, and static analysis using PHPStan.
To run the tests, run the following command from the project folder:
To run PHPUnit only:
To check code style:
To fix code style issues:
To run static analysis:
License
The Apache 2.0 license. Please see LICENSE for more information.