phpvms/app/Cron/Hourly/ClearExpiredSimbrief.php
Nabeel S 12848091a2
Laravel 9 Update (#1413)
Update to Laravel 9 and PHP 8+

Co-authored-by: B.Fatih KOZ <fatih.koz@gmail.com>
2022-03-14 11:45:18 -04:00

31 lines
682 B
PHP

<?php
namespace App\Cron\Hourly;
use App\Contracts\Listener;
use App\Events\CronHourly;
use App\Services\SimBriefService;
use Illuminate\Support\Facades\Log;
/**
* Clear any expired SimBrief flight briefs that aren't attached to a PIREP
*/
class ClearExpiredSimbrief extends Listener
{
private SimBriefService $simbriefSvc;
public function __construct(SimBriefService $simbriefSvc)
{
$this->simbriefSvc = $simbriefSvc;
}
/**
* @param CronHourly $event
*/
public function handle(CronHourly $event): void
{
Log::info('Hourly: Removing expired Simbrief entries');
$this->simbriefSvc->removeExpiredEntries();
}
}