相关疑难解决方法(0)

在Laravel中使用Google Drive API

我想在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的功能.

有谁能够帮我?

问候和感谢.

php api laravel google-drive-api

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

api ×1

google-drive-api ×1

laravel ×1

php ×1