我正在尝试搜索页面,当我的搜索表单为空时,我将从表中获取所有记录,而不是空/空。
我的路线:
Route::get('/search', 'SearchController@index');
在控制器中,我这样做:
$query = $input["query"]; //getting query from form
$results = Table::where('name', 'LIKE', '%'.$query.'%')->get();
输出:
集合{#1505▼
#items:array:5 [▶](表中的所有记录)
}
我正在尝试获取一些空集合或null
。
集合{#1505▼
#items:[]
}
答案 0 :(得分:2)
您可以检查是否设置了查询:
{
"expo": {
"android": {
"package": "com.company",
"config": {
"googleMaps": {
"apiKey": "<android maps key>"
}
}
},
"ios": {
"bundleIdentifier": "com.company",
"config": {
"googleMapsApiKey": "<ios maps api key>"
}
}
}
}