Changes to holidays and the overlap between this year and the previous year

This commit is contained in:
2026-09-23 12:20:39 +03:30
parent 5e306564b2
commit 0fd5867701
15 changed files with 653 additions and 62 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Holiday extends Model
{
protected $fillable = [
'date',
'title',
];
protected function casts(): array
{
return [
'date' => 'date',
];
}
}
+5 -4
View File
@@ -111,16 +111,17 @@ class User extends Authenticatable
if (!$date) {
continue;
}
$month = $date->format('%B');
$key = sprintf('%04d-%02d', $date->getYear(), $date->getMonth());
if (!isset($result[$month])) {
$result[$month] = [];
if (!isset($result[$key])) {
$result[$key] = [];
}
$result[$month][] = $att;
$result[$key][] = $att;
}
}
krsort($result);
return $result;
}