2016-04-26 13 views
0

laravel 5.1にoembedパッケージがありますか?私はthis packageを試してみましたが、私はLaravel 5.1 oembed

BadMethodCallException in ServiceProvider.php line 234: 
Call to undefined method [package] 

答えて

1

この1つは5.2

https://github.com/oscarotero/Embed

はコントローラ

にあなたがこれを行うことができ、その後

"embed/embed": "^2.6" 

作曲にこれを追加しLaravelに働く取得します

//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);