publi c функция imageEmmbed (запрос $ request) {
$file = $request->file('file');
$svg_data = file_get_contents($file);
$svg = new \SimpleXMLElement($svg_data, LIBXML_NOEMPTYTAG);
$svg->registerXPathNamespace('svg', 'http://www.w3.org/2000/svg');
$g_res= $svg->addChild("text", "COPYRIGHT @ 2020");
$g_res->addAttribute("x", "150");
$g_res->addAttribute("y", "220");
$g_res->addAttribute("font-family", "Verdana");
$g_res->addAttribute("font-size", "10");
$g_res->addAttribute("fill", "red");
$g_res = $svg->addChild("image","1");
$g_res->addAttribute("x", "0");
$g_res->addAttribute("y", "0");
$g_res->addAttribute("width", "50");
$g_res->addAttribute("height", "50");
$g_res->addAttribute("xlink", 'http://www.w3.org/1999/xlink');
$g_res['xlink:href'] = "enter your base64 image here.";
$g_res->addAttribute("onclick", "this.setAttributeNS('http://www.w3.org/1999/xlink')");
$dom_res = dom_import_simplexml($g_res);
$dom_svg = dom_import_simplexml($svg);
$dom_svg->formatOutput = true;
$dom_svg->appendChild($dom_res);
echo $svg->saveXML(public_path('image/test.svg'));
}