for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NovaFormEntries\Metrics;
use FormEntries\Models\FormEntry;
use Illuminate\Http\Request;
use Laravel\Nova\Metrics\Trend;
class SendingTrend extends Trend
{
/**
* Calculate the value of the metric.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function calculate(Request $request)
return $this->countByDays($request, FormEntry::class);
}
* Get the ranges available for the metric.
* @return array
public function ranges()
return [
30 => '30 Days',
60 => '60 Days',
90 => '90 Days',
];
* Get the URI key for the metric.
* @return string
public function uriKey()
return 'form-entries-per-day';
* Determine for how many minutes the metric should be cached.
* @return \DateTimeInterface|\DateInterval|float|int
public function cacheFor()
return now()->addMinutes(30);