Files
online.tbbank.gov.tm-larave…/app/Modules/DateHelper/Repositories/DateHelperRepository.php
2024-09-09 19:24:21 +05:00

35 lines
671 B
PHP

<?php
namespace App\Modules\DateHelper\Repositories;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use App\Modules\DateHelper\Models\DateHelper;
class DateHelperRepository
{
public static function monthsAsNumber(): array
{
$month = [];
for($m = 1;$m <= 12; $m++) {
$month[] = str_pad($m, 2, '0', STR_PAD_LEFT);
}
return $month;
}
public static function yearsUntil(int $max = 50): array
{
$years = [];
$currentData = date('Y');
for ($i = 0; $i <= $max; $i++) {
$years[] = intval($currentData) + $i;
}
return $years;
}
}