PHPackages                             illuminatech/data-provider - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. illuminatech/data-provider

ActiveLibrary[HTTP &amp; Networking](/categories/http)

illuminatech/data-provider
==========================

Allows easy build for DB queries from API requests

1.0.8(1mo ago)4413.3k↓31.6%4BSD-3-ClausePHPCI passing

Since Jan 21Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/illuminatech/data-provider)[ Packagist](https://packagist.org/packages/illuminatech/data-provider)[ GitHub Sponsors](https://github.com/klimov-paul)[ Patreon](https://www.patreon.com/klimov_paul)[ RSS](/packages/illuminatech-data-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (10)Used By (0)

 [ ![](https://avatars1.githubusercontent.com/u/47185924) ](https://github.com/illuminatech)

Laravel Data Provider
=====================

[](#laravel-data-provider)

This extension allows building of the complex search queries based on the request in Laravel. In particular, it is useful for REST API composition.

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/e46ebcc115b1fc4156c991b063027048a05c0d7672e927cc4724ee518f25bf25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c6c756d696e61746563682f646174612d70726f76696465722e737667)](https://packagist.org/packages/illuminatech/data-provider)[![Total Downloads](https://camo.githubusercontent.com/2947a16c57b564af1a85bf9ca077756a7a415ba65648b300f093822b2ad7d7eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c6c756d696e61746563682f646174612d70726f76696465722e737667)](https://packagist.org/packages/illuminatech/data-provider)[![Build Status](https://github.com/illuminatech/data-provider/workflows/build/badge.svg)](https://github.com/illuminatech/data-provider/actions)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist illuminatech/data-provider

```

or add

```
"illuminatech/data-provider": "*"
```

to the "require" section of your composer.json.

Usage
-----

[](#usage)

This extension allows building of the complex search queries based on the request data. It handles filtering, sorting, pagination, include of extra fields or relations on demand. Both Eloquent Active Record and plain database queries are supported.

This extension provides `Illuminatech\DataProvider\DataProvider` class, which wraps given data source object like database query builder, and provide the means to define controller-level interaction to search through this data source.

Usage example:

```
