laravel sortable column

Solutions on MaxInterview for laravel sortable column by the best coders in the world

showing results for - "laravel sortable column"
Damián
20 May 2016
1#you must install sortable before 
2#composer require kyslik/column-sortable
3#then you can use all the library as mentioned in 
4# https://www.laravelcode.com/post/laravel-7-column-sorting-with-pagination-example
5
6namespace App;
7
8use Illuminate\Database\Eloquent\Model;
9use Kyslik\ColumnSortable\Sortable;
10
11class Product extends Model
12{
13    use Sortable;
14
15    protected $fillable = [ 'name', 'price','details' ];
16
17    public $sortable = ['id', 'name', 'price','details', 'created_at', 'updated_at'];
18}