You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sdantard works module, all new items have order number last item + 1. Is it possible when a new item will be first (has position 1) and other items will be reordered automatically?
The text was updated successfully, but these errors were encountered:
You can do it by moving new item before the first item. Something like:
$post->tags()->save($newTag); // add new tag$firstTag = $post->tags()->first(); // get first tag$post->tags()->moveBefore($newTag, $firstTag); // move new tag before first tag
Sdantard works module, all new items have order number last item + 1. Is it possible when a new item will be first (has position 1) and other items will be reordered automatically?
The text was updated successfully, but these errors were encountered: