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

前端 未结 10 2035
余生分开走
余生分开走 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:34

    You can combine all HTTP verbs for a route using:

    Route::any('login', 'AuthController@login');
    

    This will match both GET and POST HTTP verbs. And it will also match for PUT, PATCH & DELETE.

提交回复
热议问题