raditzfarhan/laravel-sortable

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

Installs: 208

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:laravel-package

v1.0.0 2020-04-21 14:25 UTC

This package is auto-updated.

Last update: 2024-04-06 03:38:30 UTC


README

License styleci

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.