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

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

    Right, I'm answering using my mobile, and so I haven't tested this (if I remember correctly, it isn't in the documentation either). Here goes:

    Route::match('(GET|POST)', 'login',
        'AuthController@login'
    );
    

    That should do the trick. If it doesn't, then Taylor had it removed from the core; which would then mean that nobody was using it.

提交回复
热议问题