0
我想從數據庫目錄中讀取json
文件,但給出The Response content must be a string or object implementing __toString(), "boolean" given.
錯誤。貝婁是我的代碼:Laravel 5閱讀Json文件給出錯誤`Response.php line 403`
$json = file_get_contents('database/query_templates/course.json');
$data = json_decode($json, TRUE);
echo '<pre/>'; print_r($data); exit;
course.json
文件內容:
{
"post_filter" : {
"operator" : [
{
"operator" : [
{
"range" : {
"created_at" : {
"gte" : "log_start_date",
"lte" : "log_end_date",
"format" : "yyyy-MM-dd"
}
}
},
{
"terms" : {
"search_param_user_action.id" : "user_select_array"
}
}
]
},
{
"operator" : [
{
"operator" : [
"conduct_days_multi"
]
},
{
"operator" : [
"dropdowns"
]
}
]
},
{
"query" : {
"multi_match" : {
"query" : "x",
"fields" : [
"resource_search_columns"
],
"operator" : "operator"
}
}
}
]
}
}
任何幫助的感謝。
你的'course.json'的內容是什麼?還有哪條線給出了這個錯誤? –
@MarkDavison現在我已更新問題。 – jones
你在Laravel項目中運行此代碼的位置? –