How to use Summernote Editor in Laravel Tutorial Step by Step
HTML-код
- Опубликовано: 8 сен 2024
- How to use Summernote Editor in Laravel Tutorial Step by Step
Summnernote Link : summernote.org/
If you get helped from this tutorial, please subscribe my channel and stay with me to get more powerful tip
Thanks For Watching.
I hope This video was helpful.If you have any questions then let me know in the comment section.
Best of luck
#webtechknowledge
You can connect with me with the given links below:
Please Subscribe to this channel: / @webtechknowledge
Join this channel to get access to perks: / @webtechknowledge
Follow me on :
Facebook Link: / yaminshakil07
Instagram Link: / yamin_shakil
Twitter Link: / yaheashakil
#laravelproject #laravellibrarymanagementsystem #librarymanagementsystem #laravelprojectforbeginners
Thank you.
The Code :
$dom = new \DomDocument();
$dom->loadHtml($description, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$imageFile = $dom->getElementsByTagName('imageFile');
foreach($imageFile as $item => $image)
{
$data = $img->getAttribute('src');
list($type, $data) = explode(';', $data);
list(, $data) = explode(',', $data);
$imgeData = base64_decode($data);
$image_name= "/upload/" . time().$item.'.png';
$path = public_path() . $image_name;
file_put_contents($path, $imgeData);
$image->removeAttribute('src');
$image->setAttribute('src', $image_name);
}
$description = $dom->saveHTML();