twomein/laravel-dynatable is a Laravel package for a facade for using the dynatable format.
It currently has 3 GitHub stars and 1.309 downloads on Packagist (latest version v0.1.1).
Install it with composer require twomein/laravel-dynatable.
Discover more Laravel packages by twomein
or browse all Laravel packages to compare alternatives.
Last updated
#Work had resumed on the original Ifnot library now called White-frame so this is deprecated.
A library for sending connecting to the dynatables.js front end.
Credits to ifnot for making the original version of dynatables for laravel.
composer require twomein/laravel-dynatables
Register the service provider in the app.config
'Twomein\LaravelDynatable\LaravelDynatableServiceProvider',
Example usage:
//Get an Eloquent collection
$cars = Car::all();
//Define the columns you want to send
$columns = ['id', 'name', 'price', 'stock'];
// Build dynatable response
return Dynatable::make($cars, $columns, Input::all());
}
}
To give a little bit of insights about the inputs parameter:
'page-length' => (int)$inputs['perPage'],
'page-number' => (int)$inputs['page'],
'offset' => (int)$inputs['offset'],
'sorts' => isset($inputs['sorts']) ? $inputs['sorts'] : null,
'search' => isset($inputs['queries']['search']) ? $inputs['queries']['search'] : null,