在 Laravel 5+ 中,我在哪里可以捕获 MethodNotAllowedHttpException
?
在 Laravel 4 中,我可以在 start/global.php
中执行此操作。
最佳答案
// Exceptions/Handler.php
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
public function render($request, \Exception $e)
{
if ($e instanceof MethodNotAllowedHttpException) {
// …
}
return parent::render($request, $e);
}
关于php - Laravel 5 - 我如何处理 MethodNotAllowedHttpException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30276325/