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