Skip to content

Latest commit

 

History

History
91 lines (60 loc) · 2.98 KB

README.md

File metadata and controls

91 lines (60 loc) · 2.98 KB

Datatables

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Use Doctrine or Eloquent for Datatables' server-side processing.

Install

Via Composer

$ composer require rougin/datatables

Usage

DoctrineBuilder

use Rougin\Datatables\DoctrineBuilder;

$entity = 'Acme\Doctrine\Models\User';

$builder = new DoctrineBuilder($manager, $entity, $_GET);

header('Content-Type: application/json');

echo json_encode($builder->make());

NOTE: $manager must return an instance of Doctrine\ORM\EntityManager. See DoctrineBuilderTest::setUp for the sample implementation.

EloquentBuilder

use Rougin\Datatables\EloquentBuilder;

$model = 'Acme\Eloquent\Models\UserModel';

$builder = new EloquentBuilder($model, $_GET);

header('Content-Type: application/json');

echo json_encode($builder->make());

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer require doctrine/orm illuminate/database --dev
$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see LICENSE for more information.