public static function getTicketMessages() { //Check any operators online from company_id //Check if we have any messages from user_id , thread_id $v = Validator::make(["user_id" => Input::get('user_id'), "thread_id" => Input::get('thread_id'), "last_message_id" => Input::get('last_message_id')], ["user_id" => 'required', "thread_id" => 'required', "last_message_id" => 'required']); if ($v->passes()) { $thread_geo_info = ThreadGeoInfo::where('thread_id', Input::get('thread_id'))->first(); $response['geo'] = $thread_geo_info; $response['ticket'] = Tickets::where('thread_id', Input::get('thread_id'))->first(); $response['messages'] = MessageThread::getTicketMessages(Input::get('thread_id'), Input::get('last_message_id')); return json_encode($response); } }