A laravel package to handle the server side processing of DataTables jQuery Plugin via AJAX option by using Eloquent Query Builder.
- PHP >= 7.0
- Laravel >= 5.5
- jQuery Datatables v1.10x
$ composer require fluidtech/spock-datatables
Register provider on you conifg\app.php
file.
'providers' => [
...,
\FluidTech\SpockDataTables\SpockServiceProvider::class
]
And that's it! Now you can start building out DataTables faster!
-
Using Eloquent Query Builder
Fetches the and returns the records using the given query.
$expectedResponse = \FluidTech\SpockDataTables\DataTable::of($query, $list_of_columns) ->make();
- Accepts
$query
: The base query from which records needs to be fetched.$list_of_columns
: An list of column names that needs to be displayed.
Note : The sequence of columns should be the same as specified on the client side.
$query = DB::table('users'); return \FluidTech\SpockDataTables\DataTable::of($query, [ "name", "phone_number" ]) ->make();
- Accepts
-
Using Fluent Query Builder (Coming Soon)
-
Using Collection (Coming Soon)
The MIT License (MIT). Please see License File for more information.