File: /home/mocapict-106/mocapictures.kr/app/Services/Utility.php
<?php
namespace App\Services;
use Carbon\Carbon;
class Utility {
const CounselorRoleName = "counselor";
public static function getYearOption($start = null, $end = null): array
{
$dateOfEstablishment = '01/01/2015';
if(!$start) $start = Carbon::now()->addYears(3)->format('Y');
if(!$end) $end = Carbon::createFromFormat('m/d/Y', $dateOfEstablishment)->format('Y');
$yearList = [];
foreach(range($start, $end) as $year) {
$yearList[$year] = sprintf("%s 년",$year);
}
return $yearList;
}
}