2017 © Pedro Peláez
 

library webmozart-json-laravel

A webmozart/json service provider for Laravel

image

lukaserat/webmozart-json-laravel

A webmozart/json service provider for Laravel

  • Sunday, June 14, 2015
  • by lukaserat
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Webmozart JSON Laravel

A webmozart/json wrapper for Laravel Framework., (*1)

Installation

Use [Composer] to install the package:, (*2)

$ composer require lukaserat/webmozart-json-laravel

Laravel Users

I just combined the two major classes webmozart/json has to offer, the Encoder and Decoder, for easy usage., (*3)

Just include the service provider and that's it., (*4)

// app/config/app.php
'providers' => [
    '...',
    'Lukaserat\WebmozartJson\JsonServiceProvider'
];

Note: Facade will be automatically registered as 'JsonHelper', (*5)

When this provider is booted, you'll gain access on helpful functions from webmozart/json. See the example below:, (*6)

Encoding

Instead of this..., (*7)

// somewhere in your application..
use Webmozart\Json\JsonEncoder;
$encoder = new JsonEncoder();

// Store JSON in string
$string = $encoder->encode($data);

// Store JSON in file
$encoder->encodeFile($data, '/path/to/file.json');

You can do it this way.., (*8)

// Store JSON in string
$string = JsonHelper::encode($data);

// Store JSON in file
JsonHelper::encodeFile($data, '/path/to/file.json');

Webmozart/Json Usage

This is just a wrapper for Laravel. For more details about the webmozart/json go to its github page., (*9)

The Versions

14/06 2015

dev-master

9999999-dev

A webmozart/json service provider for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lukaserat Jonjonvi

laravel json webmozart