定制 lukaserat/webmozart-json-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lukaserat/webmozart-json-laravel

Composer 安装命令:

composer require lukaserat/webmozart-json-laravel

包简介

A webmozart/json service provider for Laravel

README 文档

README

A webmozart/json wrapper for Laravel Framework.

Installation

Use [Composer] to install the package:

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

Just include the service provider and that's it.

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

Note: Facade will be automatically registered as 'JsonHelper'

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

Encoding

Instead of this...

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

// 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
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-14