在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ivanvermeyen/laravel-google-drive-demo开源软件地址(OpenSource Url):https://github.com/ivanvermeyen/laravel-google-drive-demo开源编程语言(OpenSource Language):PHP 95.5%开源软件介绍(OpenSource Introduction):Laravel & Google Drive StorageDemo project with Laravel 5.4Look at the commit history to see each of the steps I have taken to set this up. Set up this demo project locally
I took care of this:This will also install only one additional package that is not included by Laravel out of the box:
I have included GoogleDriveAdapter and GoogleDriveServiceProvider which I have added to the 'disks' => [
// ...
'google' => [
'driver' => 'google',
'clientId' => env('GOOGLE_DRIVE_CLIENT_ID'),
'clientSecret' => env('GOOGLE_DRIVE_CLIENT_SECRET'),
'refreshToken' => env('GOOGLE_DRIVE_REFRESH_TOKEN'),
'folderId' => env('GOOGLE_DRIVE_FOLDER_ID'),
// 'teamDriveId' => env('GOOGLE_DRIVE_TEAM_DRIVE_ID'),
],
// ...
], Create your Google Drive API keysDetailed information on how to obtain your API ID, secret and refresh token:
Update |
Route | Description |
---|---|
/put | Puts a new test.txt file to Google Drive |
/put-existing | Puts an existing file to Google Drive |
/list | Lists all files in Google Drive (root directory, not recursive by default) |
/list-folder-contents | List all files in a specific folder |
/get | Finds and downloads the test.txt file from Google Drive |
/create-dir | Creates a Test Dir directory |
/create-sub-dir | Creates a Test Dir directory and a Sub Dir sub directory |
/put-in-dir | Puts a new test.txt file to the Test Dir sub directory |
/newest | Puts a new file to Google Drive and then fetches it |
/delete | Delete a file from Google Drive |
/delete-dir | Delete an entire directory from Google Drive |
/rename-dir | Rename a directory in Google Drive |
/put-get-stream | Use a stream to store and get larger files |
/share | Change permissions to share a file with the public |
/export/{basename} | Export a Google doc (to PDF) |
This is a very basic example to get you started. To see the logic behind these routes, check routes/web.php
.
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论