PHP code example of ermakk / ms-table-colorize

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

    

ermakk / ms-table-colorize example snippets


//...Resource.php

//class YourModelResource extends ModelResource
use Ermakk\MoonshineTableColorize\Traits\ColorizeTrAtribute;

// ...

protected function topButtons(): ListOf
{
    return parent::topButtons()
        ->add(
            ColorizeButton::make()->for($this)
        )
        ->// ... ваши кнопки
        ;
}


//...Resource.php

//class YourModelResource extends ModelResource
use Ermakk\MoonshineTableColorize\Traits\ColorizeTrAtribute;

// ...

    public function colorizeFields(): array
    {
        return [
            // набор полей
        ];
    }
    
// ...


//...Resource.php

// ...
protected bool $colorizeSoftDeleteEnable = true; // true - включено, false - выключено
// ... 

//...Resource.php

// ...
protected bool $colorizeCursorPointer = true; // true - включено, false - выключено
// ... 

//...Resource.php

// ...
protected string $colorizeStyleAttribute = 'background-color';
// ... 
shell
php artisan vendor:publish --tag="moonshine-table-colorize"