grohiro/laravel-camelcase-json
laravel-camelcase-json
Convert response JSON key to camelCase.
Usage
In controller class
return response()->json($model);
// => ['userName' => 'foo', 'userKey' => 'bar', ...]
Requirements
- Laravel 5+
Install
$ composer require 'grohiro/laravel-camelcase-json' '~1.0'
# Laravel 5.7+
$ composer require 'grohiro/laravel-camelcase-json' '~2.0'
Add the service provider.
config/app.php
'provider' => [
// default providers
// ...
Grohiro\LaravelCamelCaseJson\CamelCaseJsonResponseServiceProvider::class,
],
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
637,827,751
9,703
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
413,412,504
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
394,964,158
4,660
Version History
| Version | Released | License |
|---|---|---|
| 2.0.0 | MIT | |
| 1.1.0 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT |