输入如下:
public function webhook(Request $request)
{
dd($request->input);
}
// output
[{
"entry":[{
"changes":[{
"field":"leadgen",
"value":{
"ad_id":0,
"form_id":724269564418666,
"leadgen_id":8144548420666,
"created_time":1502824666,
"page_id":482428225170666,
"adgroup_id":0
}
}],
"id":"48242822517",
"time":1502824702
}],
"object":"page"
}]
$input[0]->entry[0]->changes[0]->value; // Undefined Offset 0
答案 0 :(得分:0)
Facebook正在返回的数据为JSON格式。您需要使用PHP的json_decode()函数将数据转换为可用格式,例如:
beginTransaction()