code: public function sendSuccessResponse($data)
      {
          \Yii::$app->response->format = Response::FORMAT_JSON;
          \Yii::$app->response->setStatusCode(200, $this->httpStatuses->getReasonPhrase(200));
  
          return [
              'status' => 'success',
              'data' => $data
          ];
      }
docs: Allow sending success response
  @author Oluwarotimi Akintewe <akintewe.rotimi@gmail.com>
  @author Adegoke Obasa <goke@cottacush.com>
  @param $data
  @return array