digital-creative/table-widget

A table widget for laravel nova-dashboard.

Fund package maintenance!
milewski

Installs: 2 955

Dependents: 0

Suggesters: 0

Security: 0

Stars: 8

Watchers: 2

Forks: 3

Open Issues: 0

Language:Vue

v1.0.0 2023-10-24 13:51 UTC

This package is auto-updated.

Last update: 2024-10-28 10:27:24 UTC


README

Latest Version on Packagist Total Downloads License

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.