Looking to hire Laravel developers? Try LaraJobs

laravel-json-helper maintained by chihyulin66

Author
Last update
2022/11/03 09:04 (dev-master)
License
Links
Downloads
215

Comments
comments powered by Disqus

laravel-json

introduction

I just want json encode/decode beautifully.

install

Install the package via composer

composer require chihyulin66/laravel-json-helper

Add Provider to config/app.php:

'providers' => [
    /*
     * Package Service Providers...
     */
   ChihYuLin66\LaravelJsonHelper\JsonServiceProvider::class
]

Add the Facade in config/app.php:

'aliases' => [
    // ...
    'Json' => ChihYuLin66\LaravelJsonHelper\JsonFacade::class,
]

Usage


// use
use ChihYuLin66\LaravelJsonHelper\Json;

$json = Json::encode($value);
$value = Json::decode($json);

// anywhere 
$json = app('json')->encode($value);
$value = app('json')->decode($json);