repository = $repository; } /** * query string params: * page: You can specify further pages * per_page: custom page size up to 100 ( min 10) * status: cloud status ( active , not active, all) * order_by: order by field * order_dir: order direction * @return mixed */ public function getConsultants() { return $this->getCompanyServices(); } /** * @param $id * @return mixed */ public function getConsultant($id) { return $this->getCompanyService($id); } /** * @param $id * @return mixed */ public function getOffices($id) { try { $consultant = $this->repository->getById($id); if (!$consultant) { return $this->error404(); } $offices = $consultant->offices(); $res = array(); foreach ($offices as $office) { array_push($res, $office->toArray()); } return $this->ok(array('offices' => $res)); } catch (Exception $ex) { Log::error($ex); return $this->error500($ex); } } }