Recherche des tweets de réponse avec l'API Tweeter
This commit is contained in:
46
app/Nova/Metrics/UserPerConcours.php
Normal file
46
app/Nova/Metrics/UserPerConcours.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Nova\Metrics;
|
||||
|
||||
use App\Models\Concour;
|
||||
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||
use Laravel\Nova\Metrics\Partition;
|
||||
|
||||
class UserPerConcours extends Partition
|
||||
{
|
||||
/**
|
||||
* Calculate the value of the metric.
|
||||
*
|
||||
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function calculate(NovaRequest $request)
|
||||
{
|
||||
return $this->count($request, Concour::class, 'description');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the amount of time the results of the metric should be cached.
|
||||
*
|
||||
* @return \DateTimeInterface|\DateInterval|float|int|null
|
||||
*/
|
||||
public function cacheFor()
|
||||
{
|
||||
// return now()->addMinutes(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URI key for the metric.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function uriKey()
|
||||
{
|
||||
return 'user-per-concours';
|
||||
}
|
||||
|
||||
public function name()
|
||||
{
|
||||
return 'Organisateurs';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user