/**
  * Use a ResponseObject to generate a browser redirect, based on config options
  *
  * @param              $key
  * @param BaseResponse $response
  *
  * @return Response
  */
 public function redirectViaResponse($key, BaseResponse $response)
 {
     // exit('achmadi');
     if ($response->isSuccessful()) {
         $message = ['success' => $response->getMessage()];
     } else {
         $message = ['error' => $response->getMessage()];
     }
     // Was an error caught? If so we need to redirect back.
     if ($response->isError()) {
         return Response::json(array_merge($message));
         // return $this->redirectBack($message, $response->getPayload());
     }
     return Response::json(array_merge($message));
     // return $this->redirectTo($key, $message, $response->getPayload());
 }