digital-creative/nova-data-table

Laravel Nova 卡片。

v0.1.1 2019-12-10 07:35 UTC

This package is auto-updated.

Last update: 2024-09-04 16:03:18 UTC


README

Latest Version on Packagist Total Downloads License

A Laravel Nova 数据表组件

普通数据表 NovaDataTable in Action

带行标签的数据表 NovaDataTable in Action

安装

您可以通过composer安装此包

composer require digital-creative/nova-data-table

基本用法

class ExampleNovaResource extends Resource
{

    public function cards(Request $request)
        {
            return [
                (new NovaDataTable())
                    ->columns(
                        [
                          new Columns('Name', 'name'),
                          new Columns('Age', 'age'),
                          new Columns('Address', 'address'),
                        ]
                    )->data([
                        [
                            'name' => 'Richard Needham',
                            'address' => '9293 South Peachtree Drive Rahway, NJ 07065',
                            'age' => 18
                        ],
                        [
                            'name' => 'Cari Mckenzie',
                            'address' => '8478 Tallwood St.Far Rockaway, NY 11691',
                            'age' => 24,
                        ],
                        [
                            'name' => 'Daniella Connor',
                            'address' => '7674 Hilltop Road Mcdonough, GA 30252',
                            'age' => 33
                        ],
                        [
                            'name' => 'Lamar Mac',
                            'address' => '67 Thorne Circle New Brunswick, NJ 08901',
                            'age' => 44
                        ]
                    ])
                    ->rowLabels([
                        'Label1',
                        'Label2',
                        'Label2',
                        'Label3',
                    ])
            ];
        }

}

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件