PHPackages                             calhoun/eloquent-otf - 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. calhoun/eloquent-otf

ActiveLibrary

calhoun/eloquent-otf
====================

1.0.3(8y ago)72223MITPHP

Since Jul 18Pushed 8y ago3 watchersCompare

[ Source](https://github.com/mauricecalhoun/eloquent-otf)[ Packagist](https://packagist.org/packages/calhoun/eloquent-otf)[ Docs](https://github.com/mauricecalhoun/eloquent-otf)[ RSS](/packages/calhoun-eloquent-otf/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

Eloquent On The Fly
===================

[](#eloquent-on-the-fly)

Eloquent On The Fly is a package that has been designed to help you to use Laravel's Eloquent to query array.

- [Installation](#installation)
- [Usage](#usage)
    - [As a Helper](#use_as_a_helper)
    - [As a Collection Method](#use_as_a_collection)
    - [As a Class](#use_as_a_class)
        - [Simple](#simple)
        - [Advance](#advance)

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

[](#installation)

To install through composer, simply put the following in your `composer.json` file:

```
{
    "require": {
        "calhoun/eloquent-otf": "*"
    }
}
```

And then run `composer install` from the terminal.

### Quick Installation

[](#quick-installation)

Above installation can also be simplify by using the following command:

```
composer require "calhoun/eloquent-otf"

```

Next, if you are using a version of Laravel less than 5.5 you should add the OTFServiceProvider to the providers array of your config/app.php configuration file:

```
Calhoun\OTF\OTFServiceProvider::class,

```

Usage
-----

[](#usage)

#### Use as a Helper

[](#use-as-a-helper)

To use Eloquent On The Fly as a Helper, all you need is an associative array, and closure containing your eloquent or builder query.

```
