@wireUiStyles @wireUiScripts

Datatable of Contents

A simple datatable using only the livewire-datatables template tag and a model
Take control of your datatable by adding props
Master control over each field using fluent class methods
Create aggregate columns from Eloquent relations
Delete rows by adding a delete column
<livewire:datatable-of-contents hide-header hide-pagination />
<?php

namespace App\Http\Livewire;

use App\Page;
use Illuminate\Support\Str;
use Mediconesystems\LivewireDatatables\Column;
use Mediconesystems\LivewireDatatables\Http\Livewire\LivewireDatatable;

class DatatableOfContents extends LivewireDatatable
{
    public $model = Page::class;

    public function columns()
    {
        return [
            Column::callback('title', function ($value) {
                return view('datatables::link', [
                    'href' => "/" . Str::slug($value),
                    'slot' => ucfirst($value)
                    ]);
            })
                ->label('Page')
                ->sortBy('id')
                ->defaultSort('asc'),

            Column::name('description')
        ];
    }
}