Laravel ajax post request?

1. First of all, there is a page A, the request to enter page An is a get (the framework uses laravel)
2.A page has a form, and the request method through ajax, is post
3. Question:
clipboard.png

if the request to enter the POST of page An is not processed in the route, is there any better way to add a route to the Post request?

Mar.15,2021

you can implement
through the match method or register a route with the any method to respond to all HTTP requests

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

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