feat(filters): month filters

This commit is contained in:
Michael 2025-03-19 10:57:59 +01:00
parent c2285e66c2
commit a370db7cc9

View file

@ -0,0 +1,15 @@
<?php
namespace App\Filters\FiltersType;
use Illuminate\Support\Carbon;
class MonthFilter
{
function __invoke($query, $month, $value) {
$start = Carbon::parse($value)->startOfMonth();
$end = Carbon::parse($value)->endOfMonth();
return $query->whereBetween('starts', [$start, $end]);
}
}