PHPackages                             hungnguyenba/apidriver - 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. [API Development](/categories/api)
4. /
5. hungnguyenba/apidriver

ActiveLibrary[API Development](/categories/api)

hungnguyenba/apidriver
======================

A Api based Eloquent model and Query builder for laravel (Api Eloquent)

v0.0.13(8y ago)8411PHP

Since Jan 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bahung1221/ApiDriver)[ Packagist](https://packagist.org/packages/hungnguyenba/apidriver)[ RSS](/packages/hungnguyenba-apidriver/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (13)Used By (0)

NOTE:
=====

[](#note)

This package was only used in my personal projects with special use cases, so you shouldn't use it. I will rewrite it for common use cases when i have rest time. Thank you!

---

API Driver For Laravel 5.2
==========================

[](#api-driver-for-laravel-52)

An Eloquent model and Query builder with support for Restful Api Server, using the original Laravel API. This library extends the original Laravel classes, so it uses exactly the same methods.

### Installation

[](#installation)

---

Installation using composer:

```
composer require hungnguyenba/apidriver
```

And add the service provider in `config/app.php`:

```
Hungnguyenba\Apidriver\DatabaseServiceProvider::class
```

### Configuration

[](#configuration)

---

Change your default database connection name in `config/database.php`:

```
'default' => 'api'
```

And add a new api server connection:

```
'api' => [
        'driver' => 'api',
        'host' => 'localhost/v1/',
        'database' => '',
        'prefix' => '',
]
```

### Usage

[](#usage)

---

Create new Model extend Api Eloquent Model:

```
use Hungnguyenba\Apidriver\Model\Model;

class User extends Model
{

}
```

Using the original Eloquent API:

```
$users = User::where('id', '
