get data from a date that is closest to a date sql
// Lets say you have driving school and student relationship and you want to get the upcoming lesson for a student.
// The only thing you have to do is this in Eloquent:
$upcomingLesson = PlannedLessons::query()
->where('date', '>=', now())
->first();