我想在Laravel项目中使用Google Drive API来存储PDF.不幸的是,示例代码用于常见的PHP,我不知道如何在Laravel中实现它.
<?php
require_once 'Google/Client.php';
require_once 'Google/Service/Books.php';
$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey("YOUR_APP_KEY");
$service = new Google_Service_Books($client);
$optParams = array('filter' => 'free-ebooks');
$results = $service->volumes->listVolumes('Henry David Thoreau', $optParams);
foreach ($results as $item) {
echo $item['volumeInfo']['title'], "<br /> \n";
}
Run Code Online (Sandbox Code Playgroud)
我想我必须在我的依赖项中包含https://github.com/google/google-api-php-client,但我不知道如何访问API的功能.
有谁能够帮我?
问候和感谢.