composer require mraafatcode/embedcreator
After you have installed Package, open your Laravel config file config/app.php and add the following lines.
MraafatCode\EmbedCreator\Providers\EmbedCreatorProvider::class
'EmbedCreator' => MraafatCode\EmbedCreator\EmbedCreator::class,
By use class EmbedCreator
and pass url to url()
then pass maxWidth()
in pixels(px) then embed type function at end use get()
.
youtube()
facebook()
instagram()
twitter()
vimeo()
dailymotion()
// $url = "VIDEO_URL"
$youtuebEmbed = EmbedCreator::url($url)->maxWidth(560)->youtube()->get();
// $url = "VIDEO_URL"
$VimeoEmbed = EmbedCreator::url($url)->maxWidth(600)->vimeo()->get();
// $url = "VIDEO_URL"
$dailymotionEmbed = EmbedCreator::url($url)->maxWidth(600)->dailymotion()->get();
// $url = "TWEET_URL"
$twitterEmbed = EmbedCreator::url($url)->maxWidth(450)->twitter()->get();
// $url = "VIDEO_OR_IMAGE_URL"
$instagramEmbed = EmbedCreator::url($url)->instagram()->get();
// $url = "POST_URL"
$facebookEmbed = EmbedCreator::url($url)->facebook()->get();