public function listing($page, $limit) { $response = array('data' => array(), 'paginator' => ''); if (!empty($limit)) { $countries = Country::paginate($limit); } else { $countries = Country::where('id', '>', '0')->get(); } if (!empty($countries)) { foreach ($countries as $key => $country) { $response['data'][] = $this->get($country->id, false); } } if (!empty($limit)) { $response = Utility::paginator($response, $countries, $limit); } return $response; }