Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
N

Total Records Metric

Installation Instructions

composer require nalingia/nova-total-records-metric

Readme

Nova Total Records Metric

This package provides a metric to show how many records exist for a model.

Latest Version on Packagist License

Installation

composer require nalingia/nova-total-records-metric

Usage

Use the trait HasTotal in your metric class and use the total method.

use Nalingia\TotalRecords\HasTotal;

class TotalUsers extends Value
{

    use HasTotal;

    /**
     * Calculate the value of the metric.
     *
     * @param  \Laravel\Nova\Http\Requests\NovaRequest  $request
     * @return mixed
     */
    public function calculate(NovaRequest $request)
    {
        return $this->total($request, User::class);
    }
}
Back to Top
Added 5 years ago
Last updated 5 Years Ago
Version 1.0.1
Nova Version *
Composer
nalingia/nova-total-records-metric
GitHub stars 1
Packagist downloads 9,391

Favorites

1 user favorited

Rating

N/A
(out of 5)
★★★★★
★★★★
★★★
★★
0 ratings

Author

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas