Overview

Namespaces

  • App
    • Console
      • Commands
    • Events
    • Exceptions
    • Http
      • Controllers
        • Auth
      • Middleware
      • Requests
    • Jobs
    • Providers

Classes

  • App\Console\Commands\Inspire
  • App\Console\Kernel
  • App\Events\Event
  • App\Exceptions\Handler
  • App\Http\Controllers\Auth\AuthController
  • App\Http\Controllers\Auth\PasswordController
  • App\Http\Controllers\Controller
  • App\Http\Controllers\LoginController
  • App\Http\Kernel
  • App\Http\Middleware\Authenticate
  • App\Http\Middleware\EncryptCookies
  • App\Http\Middleware\RedirectIfAuthenticated
  • App\Http\Middleware\VerifyCsrfToken
  • App\Http\Requests\Request
  • App\Jobs\Job
  • App\Providers\AppServiceProvider
  • App\Providers\AuthServiceProvider
  • App\Providers\EventServiceProvider
  • App\Providers\RouteServiceProvider
  • App\User
  • Overview
  • Namespace
  • Class
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
    /**
     * A list of the exception types that should not be reported.
     *
     * @var array
     */
    protected $dontReport = [
        HttpException::class,
        ModelNotFoundException::class,
    ];

    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param  \Exception  $e
     * @return void
     */
    public function report(Exception $e)
    {
        return parent::report($e);
    }

    /**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Exception  $e
     * @return \Illuminate\Http\Response
     */
    public function render($request, Exception $e)
    {
        if ($e instanceof ModelNotFoundException) {
            $e = new NotFoundHttpException($e->getMessage(), $e);
        }

        return parent::render($request, $e);
    }
}
API documentation generated by ApiGen