This is a proof-of-concept on how to use Google Drive as Laravel Storage System, built on top of Flysystem adapter.
- Author : David Eleazar [elzdave@student.untan.ac.id]
- Prog. Lang : PHP 7.4.*
- Framework : Laravel 8.x
- System Requirements :
- Composer
- Any databases supported by Laravel
- 3rd Party Lib :
- Clone this repository
- Using Terminal/Command Prompt,
cd
to this project's folder - Copy
.env.example
to.env
- Run
composer install
- Set application key by executing
php artisan key:generate
- Setup database connection on
.env
file - Create Google OAuth2.0 client ID, client secret, refresh token, and Google Drive folder ID by using this tutorial
- Set the following entries in your
.env
If you use Team Drive, don't forget to set the following entryGOOGLE_DRIVE_CLIENT_ID=<your-google-oauth2-client-id> GOOGLE_DRIVE_CLIENT_SECRET=<your-google-oauth2-client-secret> GOOGLE_DRIVE_REFRESH_TOKEN=<your-google-oauth2-refresh-token> GOOGLE_DRIVE_FOLDER_ID=<your-google-drive-folder-id>
GOOGLE_DRIVE_TEAM_DRIVE_ID=<your-google-drive-team-drive-id>
- Run
php artisan migrate
to create database structure - To run app, run
php artisan serve
- Upload file to Google Drive
- Index and show files from Google Drive
- Delete file from Google Drive
Feel free to lend your help to improve this apps !