This extensive tutorial will teach us how to save Laravel 9 application folder backup in Google Drive cloud storage using the Laravel Spatie backup package. To store Laravel backup in Google, we will create Laravel as a Google Drive Filesystem.
Step Build Laravel App Step Connect to Database Step Get Google Client Id, Secret, Refresh Token and Folder Id Step Install Spatie Laravel Backup Package Step Configure Google Drive Filesystem Step Register Google Drive Credentials Step Save Laravel Backup in Google Drive
In order to add Google drive in Laravel, we need to have Google Authentication API, Google Drive Service enabled in the developer console, Refresh token and Google drive folder id.
return [ 'disks' => [ 'google' => [ 'driver' => 'google', 'clientId' => env('GOOGLE_DRIVE_CLIENT_ID'), 'clientSecret' => env('GOOGLE_DRIVE_CLIENT_SECRET'), 'refreshToken' => env('GOOGLE_DRIVE_REFRESH_TOKEN'), ], ], ]; Save Laravel Backup in Google Drive