PHP code example of designbycode / laravel-datatables

1. Go to this page and download the library: Download designbycode/laravel-datatables 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/ */

    

designbycode / laravel-datatables example snippets



use Designbycode\Datatables\DataTableController;

class CategoriesDataTable extends DataTableController
{
    public function builder(): Builder
    {
        return Category::query();
    }
    
}
 

use Designbycode\Datatables\DataTableController;
use Inertia\Inertia;
use Inertia\Response;

class CategoriesDataTable extends DataTableController
{
    public function builder(): Builder
    {
        return Category::query();
    }
    
    public function index(): Response
    {
        return Inertia::render('Categories', )
    }
    
}


bash
php artisan vendor:publish --tag="datatables-config"