从网络路线上的laravel 5.4中不能使用post方法

POST method not working in laravel 5.4 , GET method is working same controller.

 Route::get('/route','PostController@custon_function'); //working

 Route::post('/route','PostController@custon_function'); //throw error

enter image description here

Option 1

You can combine GET and POST method with one route this way:

Route::match(array('GET','POST'),'/route','PostController@custom_function');

Option 2

Or you can use this alternative:

Route::any('/route', 'PostController@custom_function');

And within controller/function, you can check method name this way:

if (Request::isMethod('post'))
{
// ... this is POST method
}
if (Request::isMethod('get'))
{
// ... this is GET method
}