get data based on date in laravel 1

get data based on date in laravel

PrescriptionTbl::whereDate('created_at', date('Y-m-d'))->get();

Here is what the above code is Doing:
1. We are getting the current date using the Carbon library.
2. We are getting all the prescriptions that were created on the current date.
3. We are returning the prescriptions as a JSON response.

Similar Posts