/** * View an album. * @param $id * @param \SammyK\LaravelFacebookSdk\LaravelFacebookSdk $fb * @return \Illuminate\Http\Response */ public function show($id, LaravelFacebookSdk $fb) { // Get the album details $fb->setDefaultAccessToken($fb->getApp()->getAccessToken()->getValue()); $response = $fb->get("/{$id}?fields=id,count,name"); $album = $response->getDecodedBody(); // Get the album photos $response = $fb->get("/{$id}/photos?fields=images,link,name,source&limit=500"); $photos = $response->getDecodedBody()['data']; return View::make('gallery.album')->withAlbum($album)->withPhotos($photos); }