2015-09-02 92 views
1

我是laravel的新手。最近我從github克隆了示例項目。我嘗試做凝乳手術。當我發佈的數據,我得到laravel - Ajax Post說NotFoundHttpException

{"error":"type":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException","message":"","file":"\/home\/sq1\/lampstack-5.5.28\/apache2\/htdocs\/app\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/RouteCollection.php","line":145}} 

routes.php文件

Route::group 
(
    [ 
     'prefix' => '/executive/ajax', 
    ], 
    function() 
    { 
     Route::get 
     (
      'get-executive', 
      '[email protected]' 
     ); 
     Route::get 
     (
      'get-executive/{sponsorID}', 
      '[email protected]' 
     ); 
); 
Route::resource('/executive' ,'ExecutiveController'); 

ExecutiveController.php

public function store() //I think store action should work here 
{ 
... 
} 
public function destroy($id) 
{ 
... 
} 
public function getLeadExecutiveData($leadExecutiveID) 
{ 
... 
} 
public function update($leadExecutiveID) 
{ 
... 
} 

阿賈克斯網址http://localhost:8080/app/public/deal/executive

發表參數:

_token : WXv5u4zYkANnnWidTciFN8HVrz2ARECe669Kwvqn 
first_name : test 
last_name : test 
+0

我認爲您的網址沒有正確構建......您是如何做到的? – Amarnasan

回答

1

您要發佈帖子交易/行政,但你的資源設置爲執行。 將您的路由器更改爲:

Route::resource('deal/executive' ,'ExecutiveController');