v8enginephp/tabler

Laravel Models 的表格组件

v1.0.0 2022-03-12 18:15 UTC

This package is auto-updated.

Last update: 2024-09-05 01:52:20 UTC


README

让您的索引表格变得像做蛋糕一样简单

安装

使用 composer 安装 Tabler

    composer require v8enginephp/tabler 

用法/示例

use V8\Tabler;


class Test
{
    use Tabler;
    
    protected static function getDefaultColumns(): array
    {
        return [
            tabler_column('slug','column header',function($row){
                // This function executes the number of your records and passes $row argument as the current row record
                // by default if You dont fill this argument Table will fill with $row->slug
                return $row->id;
            }),
        ];
    } 
}

在视图中

    <?=Test::renderTable($records)?>

在 Blade 中

   {!! Test::renderTable($records) !!}

作者