I want to fetch events based on their
events table. So i need to fetch those events only which are in the future. So if current date and time is greater than
end_time then then it should not fetch those records because the the date and time has passed.
I have done so far :
$today = Carbon::now();
return $query->where('end_date', '>=', today()->format('Y-m-d'))
->where('end_time', '>=', $today->toTimeString());
But this code will not work as expected.
How can i write a query where i will be able to check first if date is today then only check time.
Thanks in advance.
from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/2uk2GSb