samedi 10 février 2018

whereBetween passing a value and null

I have an eloquent query and I am passing a value and null in it. So for example if I have an area column and I have two variables $to and $from.

example $from = 10 $to= ""

$from = 10;
$to = "";  
Product::whereBetween('area', [$from, $to])->get();

my question is that is this okay , will this work ? If no then what shall I do if I want to search from 10 to infinity ?

please assist. Thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire