vendredi 3 juin 2016

Selecting entries whose `date_field < NOW()`

When I try to run the following query, it returns nothing:

Item::where(\DB::raw('date_field < NOW()'))->get()

The reason for this is, that is null is appended to the generated MySQL query like this:

SELECT * FROM items WHERE date_field < NOW() is null;

Why does the is null part get appended to the above query?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire