jjzjj

getOrgById

全部标签

php - 拉维尔 5 : Fetch ajax data in route and pass to controller

我正在使用Laravel5并希望使用一些数据对Controller进行ajax调用:$.ajax({url:"/getOrgById",data:JSON.stringify({id:1})})routes.php有:Route::get('/getOrgById','HomeController@getOrgById');HomeController.php:publicfunctiongetOrgById($data){//codeherefailswithmessage'Missingargument1forHomeController::getOrgById()}如何将数据从a