$request->method() 和->isMethod()

$request->method()返回请求 HTTP verb,$request->isMethod()检查verb 是否匹配。如示例7-6

Example 7-6. $request->method() and $request->isMethod()
$method = $request->method();
if ($request->isMethod('patch')) {
    // Do something if request method is PATCH
}

Last updated