I am very new to the laravel framework and i have what it seems to be a simple question. I have a query like so
$query['query2']= DB::connection('test')->select(
"select * from cities");
...
...
echo json_encode($q);
Sometimes this particular query returns an empty result set. How do I handle this? Lets say I want to add my own json response when its empty. Thanks