Php laravel-Ajax帖子称NotFoundHttpException
我是拉雷维尔的新手。最近我从github克隆了示例项目。我试着做凝乳手术。当我发布我得到的数据时Php laravel-Ajax帖子称NotFoundHttpException,php,symfony,laravel,laravel-5,Php,Symfony,Laravel,Laravel 5,我是拉雷维尔的新手。最近我从github克隆了示例项目。我试着做凝乳手术。当我发布我得到的数据时 {"error":"type":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException","message":"","file":"\/home\/sq1\/lampstack-5.5.28\/apache2\/htdocs\/app\/vendor\/laravel\/framework\/src\/Illuminate\
{"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',
'LeadExecutiveController@getLeadExecutives'
);
Route::get
(
'get-executive/{sponsorID}',
'LeadExecutiveController@getLeadExecutiveData'
);
);
Route::resource('/executive' ,'ExecutiveController');
public function store() //I think store action should work here
{
...
}
public function destroy($id)
{
...
}
public function getLeadExecutiveData($leadExecutiveID)
{
...
}
public function update($leadExecutiveID)
{
...
}
ExecutiveController.php
Route::group
(
[
'prefix' => '/executive/ajax',
],
function ()
{
Route::get
(
'get-executive',
'LeadExecutiveController@getLeadExecutives'
);
Route::get
(
'get-executive/{sponsorID}',
'LeadExecutiveController@getLeadExecutiveData'
);
);
Route::resource('/executive' ,'ExecutiveController');
public function store() //I think store action should work here
{
...
}
public function destroy($id)
{
...
}
public function getLeadExecutiveData($leadExecutiveID)
{
...
}
public function update($leadExecutiveID)
{
...
}
Ajax Url:
发布参数:
_token : WXv5u4zYkANnnWidTciFN8HVrz2ARECe669Kwvqn
first_name : test
last_name : test
您正在发布到交易/执行,但您的资源设置为执行。 将路由器更改为:
Route::resource('deal/executive' ,'ExecutiveController');
我认为你的Url没有正确建立。。。你是怎么做到的?记得运行:php-artisan-route:cache