Skip to content
Icon

WARNING You're browsing the documentation for an old version of LARAVEL-DATATABLES. Consider upgrading your project to laravel-datatables 11.0.

White listing columns

Sorting and searching will only work on columns explicitly defined as whitelist.

use Datatables;
 
Route::get('user-data', function() {
$model = App\User::query();
 
return Datatables::eloquent($model)
->whitelist(['name', 'email'])
->make(true);
});