Skip to content

nalingia/nova-total-records-metric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
    }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published