nalingia / nova-total-records-metric
A Laravel Nova card.
Installs: 8 115
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 1
Language:Vue
Requires
- php: >=7.1.0
- laravel/nova: *
This package is auto-updated.
Last update: 2024-10-25 19:11:58 UTC
README
This package provides a metric to show how many records exist for a model.
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); } }