1. Go to this page and download the library: Download nyoncode/wire-sortable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nyoncode / wire-sortable example snippets
use Livewire\Component;
use NyonCode\WireSortable\Concerns\WithSortable;
use NyonCode\WireTable\Columns\TextColumn;
use NyonCode\WireTable\Concerns\WithTable;
use NyonCode\WireTable\Table;
class TaskTable extends Component
{
use WithTable, WithSortable;
public function table(Table $table): Table
{
return $table
->model(Task::class)
->reorderable('sort_order')
->columns([
TextColumn::make('title')->sortable()->searchable(),
TextColumn::make('status')->sortable(),
]);
}
}