app/Exceptions/Handler.php
/**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Exception  $exception
     * @return \Illuminate\Http\Response
     */
Render an exception into an HTTP response.
Render an exception into an HTTP response .
public function render($request, Exception $exception)
    {
        if ($exception instanceof ThrottleException) {
            return response('You are posting too frequently', 429);
        }
        return parent::render($request, $exception);
    }
public function render ( $ request , Exception $ exception ) { if ( $ exception instanceof ThrottleException ) { return response ( 'You are posting too frequently' , 429 ) ; } return parent :: render ( $ request , $ exception ) ; }
Render an exception into an HTTP response.
Render an exception into an HTTP response .
// if(app()->environment() === 'testing') throw $exception; // if ($exception instanceof ValidationException) { //     if ($request->wantsJson()) { //         return response('Sorry, validation failed', 422); //     } // } // if($request->wantsJson())