Skip to content

List and download all the files from Google Drive from selected folder using Laravel 8x

Notifications You must be signed in to change notification settings

jd-patel/laravel-google-drive

Repository files navigation

AWS and Google Drive Storage with Laravel

Demo Project With Laravel 8x

To install latest version of Laravel please type below command in your terminal

laravel new YOUR_PROJECT_NAME

Or you can setup demo project locally

git clone git@github.com:jd-patel/laravel-google-drive-s3.git

Install google drive package to your project

Add this command in your composer.json and update composer through terminal

"nao-pon/flysystem-google-drive": "~1.1"

Add GoogleDriveAdapter and GoogleDriveServiceProvider into "app/providers"

Add App\Providers\GoogleDriveServiceProvider::class, in "config/app.php"

Add disk "google" into "config/filesystems.php"


'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_ROOT_FOLDER_ID'),
    ],
],

Create your own Google Drive API Keys

For more details on how you can get your own Google Drive Keys please refer below links:

Add your google drive keys to .env file

Please add the keys you have created to .env file as below:


GOOGLE_DRIVE_CLIENT_ID=YOUR_GOOGLE_DRIVE_CLIENT_ID
GOOGLE_DRIVE_CLIENT_SECRET=YOUR_GOOGLE_DRIVE_CLIENT_SECRET
GOOGLE_DRIVE_REFRESH_TOKEN=YOUR_GOOGLE_DRIVE_REFRESH_TOKEN
GOOGLE_DRIVE_ROOT_FOLDER_ID=YOUR_GOOGLE_DRIVE_ROOT_FOLDER_ID

About

List and download all the files from Google Drive from selected folder using Laravel 8x

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published