Livewire Sortable Drag and Drop
January 16, 2026
•
1 min read
•
45 views
Table of Contents
Drag and drop sorting:
Install SortableJS
npm install sortablejs
Component
public $items = [];
public function updateOrder($orderedIds)
{
foreach ($orderedIds as $index => $id) {
Item::find($id)->update(['order' => $index]);
}
}
View with Alpine
@foreach($items as $item)
{{ $item->name }}
@endforeach
Related Posts
Laravel Sanctum API Authentication Complete Guide
Build secure API authentication with Laravel Sanctum for SPAs and mobile apps.
Laravel Rate Limiting: Protect Your Application
Implement rate limiting to protect your Laravel application from abuse.
Laravel Blade Components: Build Reusable UI
Create powerful reusable components with Laravel Blade.
Comments (0)
No comments yet. Be the first to comment!