New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

grohiro/laravel-camelcase-json

Convert response JSON key to camelCase
88,310 27
Install
composer require grohiro/laravel-camelcase-json
Latest Version:2.0.0
License:MIT
Last Updated:Jan 15, 2021
Links: GitHub  ·  Packagist
Maintainer: grohiro

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...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released License
2.0.0 MIT
1.1.0 MIT
1.0.2 MIT
1.0.1 MIT