model = new ZonesModel(); } public function getProvinces() { // $filters = [ // 'zoneid' => $this->request->getVar('zoneid') ?? null, // 'zonename' => $this->request->getVar('zonename') ?? null // ]; $rows = $this->model->getAllProvinces(); if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "data not found", 'data' => [] ], 200); } return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200); } public function getCities() { $filter = [ 'zoneid' => $this->request->getVar('zoneid') ?? null ]; $rows = $this->model->getAllCities($filter); if (empty($rows)) { return $this->respond([ 'status' => 'success', 'message' => "data not found", 'data' => [] ], 200); } return $this->respond([ 'status' => 'success', 'message'=> "Data fetched successfully", 'data' => $rows ], 200); } }