Seif5's avatar

Get image url CKEDITOR

Hello,

I have ckeditor on my laravel project and I want to make a thumbnail image for each post so I should save image url on databsae then get it . The problem is when I upload an image from Ckeditor it will be like this :

<p> <img src="myimagepath"/></p>

How can I get only the URL path image please !!

Thanks

0 likes
8 replies
jusahah87's avatar

@Amelie89 Hmm. Your thumbnail image is probably pretty small. Perhaps you could base64() it and save into database as just text string? No worrying about URLs or anything.

I don't quite know about the ckEditor, but in Summernote the editor automatically converts to base64 so that the content can be just pushed to DB.

hfn's avatar

@Amelie89 The link that I posted is a regular expression. Using something like php.net/preg_match to execute and find matches.

Where is that string coming from?

bestmomo's avatar
Level 52

@Amelie89

CKEditor is not a good way to upload image to create thumbnails. Use a simple input with for example Intervention package to save image, then save url in your database.

Please or to participate in this conversation.