Learn how to embed services using their public URL using the laravel-embed package.
A client came to me with a new requirement for their website: to be able to embed content from multiple services (YouTube, Vimeo, Slideshare etc.). This is a fairly common requirement, particularly for embedding things like YouTube videos and it’s a problem I’ve solved multiple times.
Each time I’ve done it, my approach has usually been to ask the client to fill in a “Video ID” field in the CMS. I can then use this ID to generate the appropriate embed code for the view.
This is pretty straightforward from a technical standpoint, but it’s not ideal for a few reasons:
Wouldn’t it be better if they could just put in the URL of the thing they want to embed?
Of course, but then it’s up to the application to perform the task of generating the embed code from the URL… That’s why I made laravel-embed.
#laravel #php #web-development #developer