PHP code example of ilbronza / datatables

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

    

ilbronza / datatables example snippets

 bash
php artisan vendor:publish --force --tag "datatables.assets"

public function addPostFieldsToTable()
{
	$unitloads = Unitload::gpc()::whereIn('id', request()->unitloads)->get();

	foreach($unitloads as $unitload)
		$this->getTable()->addPostField(
			FormField::createFromArray([
				'label' => $unitload->getName() . ' (' . $unitload->getQuantity() . ')',
				'type' => 'text',
				'disabled' => true,
				'name' => 'unitloads[]',
				'value' => $unitload->getKey(),
			])
		);
}

static function getFieldsGroup() : array
{
    return 
    [
        'fields' => 
        [
            'mySelfAddToDelivery' => 'warehouse::deliveries.addUnitloads'
        ]
    ];
}