Basic setup
Server-side processing in a few lines
With just a few lines of code, you can do all the server-side operations such as searching, filtering and paging.
The example below shows how easy it is to wire the Datatables PHP library into your project.
| Id | Name | Unit Price |
|---|---|---|
| Loading… | ||
<?php
use Ozdemir\Datatables\Datatables;
use Ozdemir\Datatables\DB\SQLite;
Route::get('/ajax/basic', function () {
$path = dirname(__DIR__).'/database/Chinook_Sqlite_AutoIncrementPKs.sqlite';
$dt = new Datatables(new SQLite($path));
$dt->query('Select TrackId, Name, UnitPrice from Track');
return $dt->generate();
});