PHPackages                             iphuongtt/bruno - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. iphuongtt/bruno

ActiveLibrary[Admin Panels](/categories/admin)

iphuongtt/bruno
===============

3.1.5(7y ago)1581MITPHP

Since Jul 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/iphuongtt/bruno)[ Packagist](https://packagist.org/packages/iphuongtt/bruno)[ RSS](/packages/iphuongtt-bruno/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (5)Versions (34)Used By (1)

Bruno
=====

[](#bruno)

[![Latest Version](https://camo.githubusercontent.com/553156ba8da780f7f127c63d2fbeb5b242a1bb85b103ac85df299fe991e3c826/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f697068756f6e6774742f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/iphuongtt/bruno/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/218ef5f9ce0b041ecbcd09affd24cd9700eb73e5feae41468bedb9022383205c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f697068756f6e6774742f6272756e6f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/iphuongtt/bruno)[![Coverage Status](https://camo.githubusercontent.com/81475d16631b93201bc82c56ddd51ae396093471050c096d8e135c5b6c32f36f/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f697068756f6e6774742f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/iphuongtt/bruno)[![Total Downloads](https://camo.githubusercontent.com/a9729925f11791f0f547f37d2bd7b6216e9d48b97333fbfe174f716f2962e7f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f697068756f6e6774742f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iphuongtt/bruno)

Introduction
------------

[](#introduction)

A Laravel base controller class and a trait that will enable to add filtering, sorting, eager loading and pagination to your resource URLs.

**Dedicated to Giordano Bruno**

This package is named after my hero Giordano Bruno. A true visionary who dared to dream beyond what was thought possible. For his ideas and his refusal to renounce them he was burned to the stake in 1600. [I highly recommend this short cartoon on his life narrated by Neil deGrasse Tyson](https://vimeo.com/89241669).

Functionality
-------------

[](#functionality)

- Parse GET parameters for dynamic eager loading of related resources, sorting and pagination
- Advanced filtering of resources using filter groups
- Use [Iphuongtt\\Architect](https://github.com/iphuongtt/architect) for sideloading, id loading or embedded loading of related resources
- ... [Ideas for new functionality is welcome here](https://github.com/iphuongtt/bruno/issues/new)

Tutorial
--------

[](#tutorial)

To get started with Bruno I highly recommend my article on [resource controls in Laravel APIs](http://esbenp.github.io/2016/04/15/modern-rest-api-laravel-part-2/)

Installation
------------

[](#installation)

For Laravel 5.3 and below

```
composer require iphuongtt/bruno ~2.0
```

For Laravel 5.4 and above

```
composer require iphuongtt/bruno ~3.0
```

Usage
-----

[](#usage)

The examples will be of a hypothetical resource endpoint `/books` which will return a collection of `Book`, each belonging to a `Author`.

```
Book n ----- 1 Author

```

### Available query parameters

[](#available-query-parameters)

KeyTypeDescriptionIncludesarrayArray of related resources to load, e.g. \['author', 'publisher', 'publisher.books'\]SortarrayProperty to sort by, e.g. 'title'LimitintegerLimit of resources to returnPageintegerFor use with limitFilter\_groupsarrayArray of filter groups. See below for syntax.### Implementation

[](#implementation)

```
