sendSuccess([ 'message' => __('Response has been successfully recorded', 'fluent-support'), 'status' => true, 'data' => $handler->handleEvent($request->all(), $token) ]); } catch (\Exception $e) { return $this->sendError([ 'message' => Helper::getSafeErrorMessage($e), 'status' => false ]); } } /** * handleSlackEvent responsible for getting information from integrated slack request and response * @param HandleSlackEvent $handler * @param $token * @return array */ public function handleSlackEvent(HandleSlackEvent $handler, $token) { try{ $this->sendSuccess([ 'message' => 'received', 'result' => $handler->handleEvent($token) ]); } catch (\Exception $e) { return $this->sendError([ 'message' => Helper::getSafeErrorMessage($e), 'status' => false ]); } } }