app/Exceptions/Handler.php
/**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Exception  $e
     * @return \Illuminate\Http\Response
     */
Render an exception into an HTTP response.
Render an exception into an HTTP response .
public function render($request, Exception $e)
    {
        if ($e instanceof ModelNotFoundException) {
            $e = new NotFoundHttpException($e->getMessage(), $e);
        }
        if ($e instanceof \Bican\Roles\Exceptions\RoleDeniedException) {
            return redirect()->back()->with('message', 'Permissão negada!');
        }
        return parent::render($request, $e);
    }
public function render ( $ request , Exception $ e ) { if ( $ e instanceof ModelNotFoundException ) { $ e = new NotFoundHttpException ( $ e -> getMessage ( ) , $ e ) ; } if ( $ e instanceof \ Bican \ Roles \ Exceptions \ RoleDeniedException ) { return redirect ( ) -> back ( ) -> with ( 'message' , 'Permissão negada!') ; } return parent :: render ( $ request , $ e ) ; }
Render an exception into an HTTP response.
Render an exception into an HTTP response .
// you can for example flash message, redirect...