I only want to fetch the records that were created any year of a given date regardless of the year in Laravel 9. I tried the query below.
Posts::query()->where([DAYOFMONTH(created_at)=>date('d', strtotime($dated)), MONTH(created_at)=>date('m', strtotime($dated))])->paginate(10);
How can I match only day and month and fetch the records? Thanks in advance
source https://stackoverflow.com/questions/73928641/match-only-day-and-month-and-show-records-regardless-of-year-in-laravel-eloquent
No comments:
Post a Comment