有什么用于laravel 5.1的oembed包吗?我试过this package,但我得到了
BadMethodCallException in ServiceProvider.php line 234:
Call to undefined method [package]发布于 2016-05-04 23:14:48
这个可以在Laravel 5.2中运行
https://github.com/oscarotero/Embed
将此内容添加到composer
"embed/embed": "^2.6"然后,您可以在控制器中执行此操作
//Load any url:
$info = \Embed\Embed::create('http://www.roadandtrack.com/new-cars/future-cars/news/a29059/volkswagen-golf-gti-heartbeat-concept/');
//Get content info
$info->title; //The page title
$info->description; //The page description
$info->url; //The canonical url
$info->type; //The page type (link, video, image, rich)
$info->tags; //The page keywords (tags)
$info->images; //List of all images found in the page
$info->image; //The image choosen as main image
$info->imageWidth; //The width of the main image
$info->imageHeight; //The height of the main image
$info->code; //The code to embed the image, video, etc
$info->width; //The width of the embed code
$info->height; //The height of the embed code
$info->aspectRatio; //The aspect ratio (width/height)
$info->authorName; //The (video/article/image/whatever) author
$info->authorUrl; //The author url
$info->providerName; //The provider name of the page (youtube, twitter, instagram, etc)
$info->providerUrl; //The provider url
$info->providerIcons; //All provider icons found in the page
$info->providerIcon; //The icon choosen as main icon
$info->publishedDate; //The (video/article/image/whatever) published date
dd($info);https://stackoverflow.com/questions/36860075
复制相似问题