PHP code example of raditzfarhan / laravel-sortable

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

    

raditzfarhan / laravel-sortable example snippets


namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use RaditzFarhan\LaravelSortable\Sortable;

class Post extends Model
{
    use Sortable;    

    // The ordering column in your table. Default to `sort_order`.
    // No need to set this if your ordering column name is `sort_order`.
    protected $sortable = 'ordering';
}