Skip to content

A table widget for laravel nova-dashboard.

License

Notifications You must be signed in to change notification settings

dcasia/table-widget

Repository files navigation

Nova Table Widget

Latest Version on Packagist Total Downloads License

Nova Table Widget

A table widget for laravel Nova Dashboard.

Installation

You can install the package via composer:

composer require digital-creative/table-widget

Basic Usage

use DigitalCreative\NovaDashboard\Filters;
use DigitalCreative\TableWidget\TableWidget;

class UsersWidget extends TableWidget
{
    public function fields(): array
    {
        return [
            Text::make('Name'),
            Number::make('Likes'),
            Number::make('Followers'),
        ];
    }

    public function value(Filters $filters): Collection
    {
        return Collection::range(0, 10)->map(function (int $index) {

            return [
                'name' => fake()->name(),
                'likes' => fake()->numberBetween(0, 1000),
                'followers' => fake()->numberBetween(100, 100000),
            ];

        });
    }
}

⭐️ Show Your Support

Please give a ⭐️ if this project helped you!

Other Packages You Might Like

License

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