added order saving, dragging and pinning

This commit is contained in:
KodeStar
2018-02-03 00:22:42 +00:00
parent 7c859b629e
commit 25bbf6f99a
18 changed files with 283 additions and 43 deletions

View File

@@ -11,7 +11,7 @@ class Item extends Model
{
//
protected $fillable = [
'title', 'url', 'colour', 'icon', 'description', 'pinned'
'title', 'url', 'colour', 'icon', 'description', 'pinned', 'order'
];
public static function supportedList()
@@ -25,4 +25,15 @@ class Item extends Model
{
return array_keys(self::supportedList());
}
/**
* Scope a query to only include pinned items.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePinned($query)
{
return $query->where('pinned', 1);
}
}