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

660,512,042 9,702
laravel/framework

The Laravel Framework.

625,568,548 34,998
laravel/tinker

Powerful REPL for the Laravel framework.

531,591,559 7,442
laravel/serializable-closure

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

450,320,528 608
nunomaduro/collision

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

418,503,470 4,663

Version History

Version Released License
2.0.0 MIT
1.1.0 MIT
1.0.2 MIT
1.0.1 MIT