Search
 
SCRIPT & CODE EXAMPLE
 

PHP

livewire sortable

-- Livewire Sortable Package --
CDN:
<script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v0.x.x/dist/livewire-sortable.js"></script>

NPM:
npm install livewire-sortable --save-dev

Import the package in your bundle:
import 'livewire-sortable'
// Or.
require('livewire-sortable')


Blade example of use:
<ul wire:sortable="updateTaskOrder">
    @foreach ($tasks as $task)
        <li wire:sortable.item="{{ $task->id }}" wire:key="task-{{ $task->id }}">
            <h4 wire:sortable.handle>{{ $task->title }}</h4>
            <button wire:click="removeTask({{ $task->id }})">Remove</button>
        </li>
    @endforeach
</ul>

Source: https://github.com/livewire/sortable
// Like the post if you found it usefull and help other devs to find the good answer
Comment

PREVIOUS NEXT
Code Example
Php :: php run command line 
Php :: sql in php 
Php :: how validate array in laravel in request 
Php :: add log in laravel 
Php :: how send user to 404 page if not exist page in laravel 
Php :: eloquent limit vs take 
Php :: image validate in laravel validater 
Php :: password_hash 
Php :: symfony datetime now 
Php :: php export excel 
Php :: laravel include with variable 
Php :: twig get array key name 
Php :: how to zip a folder using php 
Php :: add seconds to datetime php 
Php :: php check if value exists in multidimensional array 
Php :: php mysqli fetch single row 
Php :: laravel collection orderby 
Php :: laravel get timezone from ip address 
Php :: regex php password 
Php :: laravel migrate refresh specific migration 
Php :: laravel file permissions 
Php :: bigtext migration laravel 
Php :: Theme and plugin editor in wp dashboard missing 
Php :: PHP Read File modes 
Php :: migrate particular file laravel 
Php :: livewire not working 
Php :: php array check value exists 
Php :: php regular expressions 
Php :: wp_get_attachment alt text 
Php :: define in php 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =