Skip to content

grohiro/laravel-camelcase-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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,
],

About

Convert response JSON key to camelCase

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages