PHPackages                             nscharrenberg/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nscharrenberg/bruno

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nscharrenberg/bruno
===================

5.0.0(6y ago)0931MITPHP

Since Jul 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/nscharrenberg/bruno)[ Packagist](https://packagist.org/packages/nscharrenberg/bruno)[ RSS](/packages/nscharrenberg-bruno/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (5)Versions (33)Used By (0)

Bruno
=====

[](#bruno)

[![Latest Version](https://camo.githubusercontent.com/df6eb5365005e732607ab76b94adf43b75720ca0ada88e0e168268cb202010cc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e736368617272656e626572672f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/esbenp/bruno/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/1bfc1a91c82a7c8616c36659c63484f88b07a16df66992f74e2867886db6386c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e736368617272656e626572672f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](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
```

For Laravel 6.0 and above

```
composer require nscharrenberg/bruno ~5.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)

```
