I am using the below code to get data for today in laravel
<code>->whereMonth('dob', Carbon::now()->format('m'))
->whereDay('dob', Carbon::now()->format('d'))
->paginate(10)
</code>
<code>->whereMonth('dob', Carbon::now()->format('m'))
->whereDay('dob', Carbon::now()->format('d'))
->paginate(10)
</code>
->whereMonth('dob', Carbon::now()->format('m'))
->whereDay('dob', Carbon::now()->format('d'))
->paginate(10)
But i like to get the data for yesterday, any ideas?
1
Found this answer, the below worked for me..thank you
<code>->whereMonth('dob', Carbon::now()->format('m'))->whereDay('dob', Carbon::yesterday()->format('d'))->paginate(10),
</code>
<code>->whereMonth('dob', Carbon::now()->format('m'))->whereDay('dob', Carbon::yesterday()->format('d'))->paginate(10),
</code>
->whereMonth('dob', Carbon::now()->format('m'))->whereDay('dob', Carbon::yesterday()->format('d'))->paginate(10),
1
<code>->whereMonth('dob', Carbon::yesterday()->format('m'))
->whereDay('dob', Carbon::yesterday()->format('d'))
->paginate(10)
</code>
<code>->whereMonth('dob', Carbon::yesterday()->format('m'))
->whereDay('dob', Carbon::yesterday()->format('d'))
->paginate(10)
</code>
->whereMonth('dob', Carbon::yesterday()->format('m'))
->whereDay('dob', Carbon::yesterday()->format('d'))
->paginate(10)
you’ll have to do yesterday()
for the month and the day