Deletable

2514
eos commodi vel
Quia beatae non...
15/10/2020

Delete 2514

Are you sure?
2512
aspernatur praesentium fugit
Nemo eaque et si...
15/10/2020

Delete 2512

Are you sure?
2511
est unde nesciunt
Facere blanditii...
15/10/2020

Delete 2511

Are you sure?
2510
ducimus dicta molestiae
Consequatur dolo...
15/10/2020

Delete 2510

Are you sure?
2509
dolorum facilis nisi
Enim perspiciati...
15/10/2020

Delete 2509

Are you sure?
2508
officia labore distinctio
Aut ut impedit m...
15/10/2020

Delete 2508

Are you sure?
2507
ut unde perferendis
Praesentium rem...
15/10/2020

Delete 2507

Are you sure?
2506
optio assumenda et
Ut in repudianda...
15/10/2020

Delete 2506

Are you sure?
2505
id assumenda dolor
Aut rerum volupt...
15/10/2020

Delete 2505

Are you sure?
2504
aut optio nihil
Velit quia solut...
15/10/2020

Delete 2504

Are you sure?
Previous
Results 1 - 10 of 2513
<livewire:deletable-demo-table />

<livewire:restore-all model="App\Post" />
<?php

namespace App\Http\Livewire;

use App\Post;
use Mediconesystems\LivewireDatatables\Column;
use Mediconesystems\LivewireDatatables\DateColumn;
use Mediconesystems\LivewireDatatables\NumberColumn;
use Mediconesystems\LivewireDatatables\Http\Livewire\LivewireDatatable;

class DeletableDemoTable extends LivewireDatatable
{
    public $model = Post::class;

    public function columns()
    {
        return [
            NumberColumn::name('id')->filterable(),
            Column::name('title')->filterable()->searchable(),
            Column::name('body')->truncate()->filterable()->searchable(),
            DateColumn::name('created_at')->filterable(),
            Column::delete()->label('delete')->alignRight()
        ];
    }
}
<?php

namespace App\Http\Livewire;

use Livewire\Component;

class RestoreAll extends Component
{
    public $model;

    public function mount($model)
    {
        $this->model = $model;
    }

    public function restoreAll()
    {
        $this->model::onlyTrashed()->get()->each->restore();
        $this->emit('refreshLivewireDatatable');
    }

    public function render()
    {
        return <<<'blade'
            <div class="flex justify-center">
                <button wire:click="restoreAll" class="px-3 py-2 bg-orange-600 text-white rounded hover:bg-orange-800 focus:outline-none">Restore All</button>
            </div>
        blade;
    }
}