improve the lessonsFilter function to use Carbon's comparison functions