Looking to hire Laravel developers? Try LaraJobs

laravel-sortable maintained by raditzfarhan

Description
Just a simple sortable behaviour for your Laravel and Lumen eloquent model.
Author
Last update
2020/05/05 21:10 (dev-develop)
License
Links
Downloads
209

Comments
comments powered by Disqus

Laravel Sortable

Just a simple sortable behaviour for your Laravel and Lumen eloquent model.

Installation

Via Composer

$ composer require raditzfarhan/laravel-sortable:^1.0

Usage

Add the Sortable trait to your model:

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';
}

Credits

License

MIT. Please see the license file for more information.