digital-creative/nova-data-table

A Laravel Nova card.

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

This package is auto-updated.

Last update: 2024-12-04 16:29:41 UTC


README

Latest Version on Packagist Total Downloads License

A Laravel Nova Data Table Component

Regular data table NovaDataTable in Action

Data table with row labels NovaDataTable in Action

Installation

You can install the package via composer:

composer require digital-creative/nova-data-table

Basic Usage

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',
                    ])
            ];
        }

}

License

The MIT License (MIT). Please see License File for more information.