承接 sorskod/larasponse 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sorskod/larasponse

最新稳定版本:1.0.2

Composer 安装命令:

composer require sorskod/larasponse

包简介

无描述信息

README 文档

README

NOTE: Laravel 5 is still in development but there is a working branch which support it - dev-L5. Feel free to check the code and contribute.

Larasponse

Beautiful and easy to use API responses. It uses League/Fractal as a default provider.

Installation

Add Larasponse to your composer.json file:

"require": {
    "sorskod/larasponse": "~1.0"
}

and run composer update sorskod/larasponse

Registering the Package

Register the service provider within the providers array found in app/config/app.php:

'providers' => array(
    // ...
    'Sorskod\Larasponse\LarasponseServiceProvider'
)

Usage

Here is various examples in single controller:

use Sorskod\Larasponse\Larasponse;

class UserController extends BaseController
{
    protected $response;

    public function __construct(Larasponse $response)
    {
        $this->response = $response;

        // The Fractal parseIncludes() is available to use here
        $this->response->parseIncludes(Input::get('includes'));
    }

    public function index()
    {
        return $this->response->paginatedCollection(User::paginate());
    }

    public function show($id)
    {
        return $this->response->item(User::find($id), new UserTransformer());
    }


    public function collection()
    {
        return $this->response->collection(User::all(), new UserTransformer(), 'users');
    }
}

Read more...

统计信息

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

GitHub 信息

  • Stars: 76
  • Watchers: 4
  • Forks: 20
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固