PHP code example of webakula-admin-ext / grid-sortable-city

1. Go to this page and download the library: Download webakula-admin-ext/grid-sortable-city 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/ */

    

webakula-admin-ext / grid-sortable-city example snippets




use Illuminate\Database\Eloquent\Model;
use Spatie\EloquentSortable\Sortable;
use Spatie\EloquentSortable\SortableTrait;

class MyModel extends Model implements Sortable
{
    use SortableTrait;

    public $sortable = [
        'order_column_name' => 'order_column',
        'sort_when_creating' => true,
    ];
}

$grid = new Grid(new MyModel);

$grid->sortable();
shell
php artisan vendor:publish --provider="Encore\Admin\GridSortable\GridSortableServiceProvider"