Skip to content

Commit

Permalink
Merge pull request #11 from errand/patch-1
Browse files Browse the repository at this point in the history
fix: make scopeWhereOccurresBetween work
  • Loading branch information
mohammedmanssour authored Jan 22, 2024
2 parents 16a942e + 14a8b3c commit ee69d0b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Models/Repetition.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ public function scopeWhereOccurresBetween(Builder $query, Carbon $start, Carbon
$end,
);

foreach ($dates as $date) {
$query->orWhere(fn ($query) => $query->whereOccurresOn($date));
}
$query->where(function (Builder $query) use ($dates) {
foreach ($dates as $date) {
$query->orWhere(fn ($query) => $query->whereOccurresOn($date));
}
});

return $query;
}
Expand Down

0 comments on commit ee69d0b

Please sign in to comment.