programic / laravel-convert-case-middleware
Convert request and response keys to and from camel and snake case.
Installs: 11 814
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 1
Type:package
Requires
- php: >=7.1 || ^8.0
- ext-json: *
- laravel/framework: ^5.2 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 | ^11.0
Requires (Dev)
- orchestra/testbench: ^7.1 || ^8.0 || ^9.0
- phpunit/phpunit: ^8.5.23 || ^9.5.10 || ^10.5 || ^11.0.1
README
Convert requests from camel case to snake case. Convert responses from snake case to camel case.
#Installation
composer require programic/laravel-convert-case-middleware
- Add the middleware to the appropriate group in
App\Http\Kernel.php
. For example
protected $middlewareGroups = [
'api' => [
'throttle:60,1',
'bindings',
\Programic\LaravelConvertCaseMiddleware\ConvertRequestToSnakeCase::class,
\Programic\LaravelConvertCaseMiddleware\ConvertResponseToCamelCase::class,
],
];