How to check request method is GET or POST in Laravel?

By Hardik Savani | May 5, 2016 | | 2624 Viewer | Category : Laravel

Share this post:

Sometimes we require to get request method is get, post, patch, delete that way we can take action. if need take action on depend on request input method. so you can check using request method so let's see bellow examle:


$method = $request->method();

if ($request->isMethod('post')) {

print('is post method');


if ($request->isMethod('get')) {

print('post method');