function ajax_postComment(Request $request) { if (!$request->ajax()) { return; } $data = $request->all(); $comment = new Comment(); $comment->user_id = Auth::user()->id; $comment->production_id = $data[Comment::ATTR_PRODUCTION_ID]; $comment->content = Util::removeURLsFromText(strip_tags($data[Comment::ATTR_CONTENT]), "[Enlace bloqueado]"); $comment->created_at = DateUtil::getCurrentTime(); $comment->save(); return json_encode(array("content" => $comment->content)); }