vendredi 17 novembre 2017

Why won't my Laravel collection filter correctly by date?

I have

  $dt = Carbon::now();
  $b4 = Carbon::now()->addWeeks(12);

  Event::orderBy('date', 'desc')
    ->where('date', '<', $b4)
    ->where('ends', '>=', $dt)
    ->orWhere('date', '>=', $dt)
    ->take(3)
    ->get();

All filters work except the first where. I tried it following the orWhere first, no dice. It displays items with the date in August 2018. Help?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire