Actually the scenario is my queries are running on the basis of if condition. In first scenario
if ($a != "") {
$getData = DB::table('students')->where([
['code', '=', '1'],
['class', '!=', 'General'],
['gender', '=', 'm']
]);
}
> //second scenario
if ($b != '') {
$queryData = $getData->where(ST_Distancesphere(geom, ST_SetSRID(ST_MakePoint($longt, $latt), 4326)), '<', $b)->get();
} else {
$queryData = $getData->get();
}
return $queryData;
in first scenario query is working fine but when $b is not equal to blank then where condition is not working