php – Laravel 5 – 如何处理MethodNotAllowedHttpException
发布时间:2020-12-14 19:46:44 所属栏目:大数据 来源:网络整理
导读:在Laravel 5中我在哪里捕获MethodNotAllowedHttpException异常.在laravel 4中我可以在start / global.php中执行此操作 // Exceptions/Handler.phpuse SymfonyComponentHttpKernelExceptionMethodNotAllowedHttpException;public function render($reques
|
在Laravel 5中我在哪里捕获MethodNotAllowedHttpException异常.在laravel 4中我可以在start / global.php中执行此操作
// Exceptions/Handler.php
use SymfonyComponentHttpKernelExceptionMethodNotAllowedHttpException;
public function render($request,Exception $e)
{
if ($e instanceof MethodNotAllowedHttpException) {
// …
}
return parent::render($request,$e);
}
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
