Recherche des tweets de réponse avec l'API Tweeter

This commit is contained in:
hugol
2024-11-17 13:55:25 +01:00
parent 3d386178bf
commit 8dc18553ec
1751 changed files with 379552 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
<?php
namespace App\Nova\Metrics;
use App\Models\Concour;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Metrics\Trend;
class ConcoursPerDay extends Trend
{
/**
* Calculate the value of the metric.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return mixed
*/
public function calculate(NovaRequest $request)
{
return $this->countByDays($request, Concour::class);
}
/**
* Get the ranges available for the metric.
*
* @return array
*/
public function ranges()
{
return [
7 => __('7 Jours'),
14 => __('14 Jours'),
30 => __('30 Jours'),
60 => __('60 Jours'),
90 => __('90 Jours'),
];
}
/**
* 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 'concours-per-day';
}
public function name()
{
return 'Tendances des Concours';
}
}

View File

@@ -0,0 +1,54 @@
<?php
namespace App\Nova\Metrics;
use App\Models\Concour;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Metrics\Value;
class NewConcours extends Value
{
/**
* 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);
}
/**
* Get the ranges available for the metric.
*
* @return array
*/
public function ranges()
{
return [
'TODAY' => __('Aujourd\'hui'),
30 => __('30 Jours'),
60 => __('60 Jours'),
365 => __('365 Jours'),
'MTD' => __('Mois à date'),
'QTD' => __('Trimestre à date'),
'YTD' => __('Année à date'),
];
}
/**
* 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);
}
public function name()
{
return 'Concours Participés';
}
}

View 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';
}
}