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