The abort function throws an HTTP exception which will be rendered by the exception handler:
abort(403);
            ($request->user() instanceof MustVerifyEmail &&

            ! 
$request->user()->hasVerifiedEmail())) {

            return 
$request->expectsJson()

                    ? 
abort(403'Your email address is not verified.')

                    : 
Redirect::guest(URL::route($redirectToRoute ?: 'verification.notice'));

        }
    function abort_if($boolean$code$message '', array $headers = [])

    {

        if (
$boolean) {

            
abort($code$message$headers);

        }

    }

}
    function abort_unless($boolean$code$message '', array $headers = [])

    {

        if (! 
$boolean) {

            
abort($code$message$headers);

        }

    }

}
        $router->post('api/error', [

            
'uses' => function () {

                
abort(500);

            },

        ]);