public function getIndex() { $data = Icash::orderBy('icc_created_at', 'DESC')->get(); if (count($data) > 0) { $response = array("status" => "success", "cardhistory" => $data); } else { $response = array("status" => "failure", "message" => "no data found"); } return Response::json($response); }