webman-framework icon indicating copy to clipboard operation
webman-framework copied to clipboard

methodNotAllowedFallback对405 Method Not Allowed 的支持

Open sunsgneayo opened this issue 1 year ago • 0 comments

添加了对405 Method Not Allowed的支持; 使用和Route::fallback相似:

Route::methodNotAllowedFallback(function(){
    // 允许的请求方式
    var_dump(\Webman\App::$allowedMethods);
    return json(['code' => 405, 'msg' => '405 Method Not Allowed']);
});

谢谢亮哥哥!😀

sunsgneayo avatar Sep 20 '23 03:09 sunsgneayo