PHP code example of devmi / datatables

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

    

devmi / datatables example snippets


use App\User;
use Devmi\Datatables\Controllers\DatatableController;


class UserController extends DatatableController
{
    public function builder()
    {
        return User::query();
    }

    //...
}

/**
 * Allows admin to add new record on database
 */

$allowCreation: Bool

public function getDisplayableColumns()
{
    return ['columns', 'you', 'need', 'to', 'display'];
}

public function getUpdatableColumns()
{
    return ['updateable', 'columns'];
}

public function store(Request $request)
{
    // Add validation for example
    parent::store($request);
}

public function update($id, Request $request)
{
    // Add validation for example
    parent::update($id, $request);
}

php artisan make:controller UserController

php artisan vendor:publish --tag=devmi