app/Http/Controllers/BaseController.php
// redirect to a page/route if the request is HTTP
redirect to a page/route if the request is HTTP
redirect to a page / route if the request is HTTP
protected function responseRedirect($route, $message, $type = 'info', $error = false, $withOldInputWhenError = false)
{
    $this->setFlashMessage($message, $type);
    $this->showFlashMessages();
    if ($error && $withOldInputWhenError) {
        return redirect()->back()->withInput();
    }
    return redirect()->route($route);
}
protected function responseRedirect ( $ route , $ message , $ type = 'info' , $ error = false , $ withOldInputWhenError = false ) { $ this -> setFlashMessage ( $ message , $ type ) ; $ this -> showFlashMessages ( ) ; if ( $ error && $ withOldInputWhenError ) { return redirect ( ) -> back ( ) -> withInput ( ) ; } return redirect ( ) -> route ( $ route ) ; }
redirect to a page/route if the request is HTTP
redirect to a page / route if the request is HTTP
//Set flash message using the setFlashMessage function provided by the flash messages trait //show messages //return back if there is error with input //if no error, then return to the route