The method method will return the HTTP verb for the request.
You may use the isMethod method to verify that the HTTP verb matches a given string:
$method = $request->method();
if ($request->isMethod(‘post’)) {
//
}
The method method will return the HTTP verb for the request.
You may use the isMethod method to verify that the HTTP verb matches a given string:
$method = $request->method();
if ($request->isMethod(‘post’)) {
//
}