September 6, 2020
Category : Laravel
How to check request method is GET or POST in Laravel?
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:
Example:
$method = $request->method();
if ($request->isMethod('post')) {
print('is post method');
}
if ($request->isMethod('get')) {
print('post method');
}

Hardik Savani
I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.