Laravel / Eloquent whereIn with null -
how apply laravel's eloquent wherein() includes null?
i've tried:
user::wherein("column", [null, 1, 2]) -> get();
and
user::wherein("column", [db::raw("null"), 1, 2]) -> get();
but both queries return no results.
thanks!
i don't think can pass null
in in
mysql statement. if run query in mysql console skip null.
try user::wherenull('column')->orwherein('column', array(1, 2))->get();
Comments
Post a Comment