resSuccess(null, $res_status, $msg, $status_msg, $result); }else { $res_status = false; $msg = 'Data tidak ditemukan'; $status_msg = $msg; return $this->resSuccess(null, $res_status, $msg, $status_msg, null); } } public function resSuccess($param = null, $status = null, $msg = null, $status_msg = null, $result = null) { $response['response'] = array( 'status' => $status, 'message' => $msg, 'status_msg' => $status_msg, ); $response['param'] = !empty($param) ? $param : ''; $response['results'] = $result; return response()->json($response, 200); } }