2019-08-07 05:48:00 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Cron\Nightly;
|
|
|
|
|
|
|
|
use App\Contracts\Listener;
|
|
|
|
use App\Events\CronNightly;
|
|
|
|
use App\Services\VersionService;
|
2021-03-03 04:43:34 +08:00
|
|
|
use Illuminate\Support\Facades\Log;
|
2019-08-07 05:48:00 +08:00
|
|
|
|
|
|
|
class NewVersionCheck extends Listener
|
|
|
|
{
|
|
|
|
private $versionSvc;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param VersionService $versionSvc
|
|
|
|
*/
|
|
|
|
public function __construct(VersionService $versionSvc)
|
|
|
|
{
|
|
|
|
$this->versionSvc = $versionSvc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set any users to being on leave after X days
|
|
|
|
*
|
|
|
|
* @param CronNightly $event
|
|
|
|
*/
|
|
|
|
public function handle(CronNightly $event): void
|
|
|
|
{
|
2021-03-03 04:43:34 +08:00
|
|
|
Log::info('Nightly: Checking for new version');
|
2019-08-07 05:48:00 +08:00
|
|
|
$this->versionSvc->isNewVersionAvailable();
|
|
|
|
}
|
|
|
|
}
|