public static function latestPredictions() { $page = Input::get('start'); $total = Input::get('total'); $page = !empty($page) ? $page : 1; $per_page = 5; $total_count = isset($total) ? $total : Prediction::find_last_top_result_count(); //pagination class declaration $pagination = new Pagination($page, $per_page, $total_count); //main search function calling $records = isset($pagination) ? Prediction::find_last_top_result($per_page, $pagination->offset()) : false; return $records; }