PHP code example of dilum / puppy-data-table
1. Go to this page and download the library: Download dilum/puppy-data-table library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dilum / puppy-data-table example snippets
bash
return DataTable::of(User::query())
->searchable(['name', 'email'])
->addColumn('status', function ($user) {
return $user->is_active ? 'Active' : 'Inactive';
})
->toResponse(request());