PHPackages                             gruz/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. gruz/bruno

ActiveLibrary

gruz/bruno
==========

6.0.1(4y ago)0241MITPHP

Since Jul 28Pushed 4y agoCompare

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

READMEChangelog (1)Dependencies (6)Versions (36)Used By (1)

Bruno
=====

[](#bruno)

[![Latest Version](https://camo.githubusercontent.com/b85d763654d410e4c560cdd917fb701e33d3d27b56f5328c2640d4bc89d816d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f657362656e702f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/esbenp/bruno/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/968297ce49b2a564c250d5b27293123748931ccfffdbec357c133f7707632d4b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f657362656e702f6272756e6f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/esbenp/bruno)[![Coverage Status](https://camo.githubusercontent.com/bcf4b569f000e913ccb7153b23fbcad8adaa5134e753bfe3ac2f15c7d3c3e8c7/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f657362656e702f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/esbenp/bruno)[![Total Downloads](https://camo.githubusercontent.com/d40dd7c4ad988912019fd9c0aff9985fc61d7e63a482cb76e30330617ab6c8e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f7074696d75732f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/optimus/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 [Optimus\\Architect](https://github.com/esbenp/architect) for sideloading, id loading or embedded loading of related resources
- ... [Ideas for new functionality is welcome here](https://github.com/esbenp/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 optimus/bruno ~2.0
```

For Laravel 5.4 and above

```
composer require optimus/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)

```
