How to route GET and POST for same pattern in Laravel?

前端 未结 10 1916
余生分开走
余生分开走 2020-12-24 10:55

Does anyone know of any way in Laravel 4 which combines these 2 lines into one?

Route::get(\'login\', \'AuthControl         


        
10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-24 11:38

    You could try the following:

    Route::controller('login','AuthController');
    

    Then in your AuthController class implement these methods:

    public function getIndex();
    public function postIndex();
    

    It should work ;)

提交回复
热议问题