PHP code example of nalingia / nova-total-records-metric
1. Go to this page and download the library: Download nalingia/nova-total-records-metric library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nalingia / nova-total-records-metric example snippets
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);
}
}