定制 plata/fravel 二次开发

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

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

plata/fravel

Composer 安装命令:

composer require plata/fravel

包简介

A Fractal wrapper for Laravel

README 文档

README

License

A Fractal wrapper for Laravel

Fractal is designed in such a way that it could be used by any frameworks or no framework at all. But wouldn't it be cool if we can use it like it's build right on top of Laravel?

Installation

Composer

composer require plata/fravel

Then in your config/app.php's provider array:

'providers' => [
  // ...
  'Plata\Fravel\FravelServiceProvider::class',
  // ...
]

and within the same file,

'aliases' => [
  // ...
  ''Fractal' => \Plata\Fravel\Facade\Fractal::class',
  // ...
]

Usage

For a collection of resource,

$resource = Fractal::collection(User::all(), $transformer);

return Response::fractal($resource);

For a single resource,

$resource = Fractal::item(User::find(1), $transformer);

return Response::fractal($resource);

Generators

Everyone knows that developers doesn't like repetitive tasks. That's why generators are really helpful for creating a base template for you!

Transformers

Existing Model and Migration

php artisan make:transformer UserTransformer

For non existing model/migration, just append -t flag

php artisan make:model User -m -t

Configurations

Fravel ships with a configuration file where you can change any Fractal specific behaviour. Just run:

php artisan vendor:publish

Support

Need more control? Check this thorough documentation of Fravel.

统计信息

  • 总下载量: 553
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-06-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固