Laravel Routing: Route that responds to multiple HTTP verbs

Route that responds to multiple HTTP verbs

Route::match(['get', 'post'], '/', function () {
    //
});

Route::any('foo', function () {
    //
});

You may do so using the match method. Or, you may even register a route that responds to all HTTP verbs using the any method.

Related concepts

Route that responds to multiple HTTP verbs

Laravel Routing: Route that responds to multiple HTTP verbs — Structure map

Clickable & Draggable!

Laravel Routing: Route that responds to multiple HTTP verbs — Related pages: