继续预订 单击按钮我调用下面的ajax功能代码
$("#add_cart").click(function() {$.ajax({ url: 'roombooking', type: "get", data: {id:data}, success: function(response){ // What to do if we succeed if(data == "success") alert(response); } }); });
路线
Route::post('roombooking','pagescontroller@roombooking');
控制器
public function roombooking($id,request $req) { $input = $req->all(); return view ('pages.roombooking')->with('id',$id); }
答案 0 :(得分:0)
Route::post('roombooking','pagescontroller@roombooking');
更改为
Route::get('roombooking','pagescontroller@roombooking');