walkor / webman-framework

webman-framework
116 stars 57 forks source link

methodNotAllowedFallback对405 Method Not Allowed 的支持 #90

Open sunsgneayo opened 11 months ago

sunsgneayo commented 11 months ago

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

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

谢谢亮哥哥!😀