setApplicationName("BookInventory"); $client->setDeveloperKey(env('GOOGLE_BOOKS_KEY')); $service = new Google_Service_Books($client); $results = $service->volumes->listVolumes('isbn:' . $isbn); /** * @var \Google_Service_Books_Volume */ $volume = Arr::first($results->getItems())->getVolumeInfo(); return (object) [ 'title' => $volume->getTitle(), 'authors' => $volume->getAuthors(), 'images' => $volume->getImageLinks(), 'description' => $volume->getDescription(), 'published_date' => $volume->getPublishedDate(), 'pages' => $volume->getPageCount() ]; } }