2015-09-02 93 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');