ldc-cocotte/app/Console/Commands/GetPublicHolidayNextYear.php

35 lines
853 B
PHP

<?php
namespace App\Console\Commands;
use App\Jobs\GetPublicHolidayForNextYear;
use Illuminate\Console\Command;
class GetPublicHolidayNextYear extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'uwil:get-public-holiday {year?}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'fetch the public holiday for a specific year or by default for the next year';
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$year = $this->argument('year');
(new GetPublicHolidayForNextYear($year))->handle();
$this->info("Les jours fériés de l'année " . ($year ?? (now()->year + 1)) . " ont été récupéré.");
}
}