<?php
/**
 * @var \Illuminate\Database\Eloquent\Collection $posts
 */
use kernel\CollectionTableRenderer;

$table = new CollectionTableRenderer($posts);

$table->setColumns([
    'id' => 'ID',
    'title' => 'Название',
]);

$table->setTableAttributes([
    'style' => 'margin-top:20px;'
]);

$table->addCustomColumn('action', 'Действия', function ($post) {
    $btn = '<a href="/admin/svo-theme/delete_slide/' . $post->id . '" class="btn btn-sm btn-danger">Удалить</a> ';

    return $btn;
});


$table->render();