Skip to content

ChihYuLin66/laravel-json-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Laravel Json Helper

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages