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

ActiveLibrary

faisalrizal/bruno
=================

3.1.2(8y ago)025MITPHP

Since Jul 28Pushed 8y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (5)Versions (28)Used By (0)

Bruno
=====

[](#bruno)

[![Latest Version](https://camo.githubusercontent.com/be845ca3635344b74d2b08ac1ee1a0c4f577129d82999247e299d041b282df8e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f66616973616c72697a616c2f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/faisalrizal/bruno/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/97fd3e9135dbee230656687cf1cf2324fa046fabf0a43e20c659b551161cb761/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66616973616c72697a616c2f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faisalrizal/bruno)[![Build Status](https://camo.githubusercontent.com/5f405908f9058e2dba9d788dc30b9d03ec85951596f309b389ba8694d00fb6c3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f66616973616c72697a616c2f6272756e6f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/faisalrizal/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)

```
composer require jasahub/bruno
```

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)

```
