added error handler
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
<?php namespace App\Exceptions;
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
||||
|
||||
class Handler extends ExceptionHandler {
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
||||
/**
|
||||
* A list of the exception types that should not be reported.
|
||||
@@ -34,9 +38,16 @@ class Handler extends ExceptionHandler {
|
||||
* @param \Exception $e
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
// public function render($request, Exception $e)
|
||||
// {
|
||||
// return parent::render($request, $e);
|
||||
// }
|
||||
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
if ($e instanceof MethodNotAllowedHttpException) {
|
||||
abort(404);
|
||||
}
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user