【发布时间】:2019-07-23 00:51:17
【问题描述】:
我在视图上有一个像这样的ajax请求方法:
$.ajax({
data: { test : 1337, _token: "{{csrf_token()}}" },
type: "POST",
url: '{{ route("get_image_by_parent_id") }}',
success: function (res) {
console.log(res)
},
});
这是我的路线代码:
Route::post('backend/blog/get_image_by_parent_id', 'Backend\BlogController@get_image_by_parent_id')->name('get_image_by_parent_id');
这是我的控制器:
public function get_image_by_parent_id(Request $request)
{
echo json_encode($request);
}
当我查看网络选项卡时,它会这样显示:
谁能帮帮我?
【问题讨论】:
标签: jquery ajax laravel laravel-5