在命名空间下定义的routes.php中的一个路由在laravel 5.2中不起作用

时间:2016-04-21 12:19:01

标签: laravel laravel-5.2 laravel-routing

Route::group(['namespace' => 'Test1', 'middleware' => 'web'], function() {
    Route::get('/instruction1', array('as' => 'instruction1', 'uses' => 'TestController1@instructionPage'));
    Route::get('/test1', array('as' => 'test1', 'uses' => 'TestController1@index'));
    Route::post('/test1/ajaxques', array('as' => 'ajaxques', 'uses' => 'TestController1@getNextQues1'));
    Route::post('/result1', array('as' => 'result1', 'uses' => 'TestController1@getResult1'));
    Route::get('/yearexam', array('as' => 'yearexam', 'uses' => 'TestController1@year'));

});

这里是第三条路线,即

Route::post('/test1/ajaxques', array('as' => 'ajaxques', 'uses' => 'TestController1@getNextQues1'));

没有在TestController1中调用getNextQues1方法。

1 个答案:

答案 0 :(得分:0)

我认为你正在做一个获取请求,但你定义了一个后期路线。

Route::post更改为Route::get