Download the PHP package hassan-shahriar-1/laravel-google-drive-backup without Composer

On this page you can find all versions of the php package hassan-shahriar-1/laravel-google-drive-backup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-google-drive-backup

Laravel Google Drive Backup

Tests PHP Laravel

Policy-based Laravel backup management with Google Drive as a backup destination.

This package provides a focused integration layer that connects Laravel applications to Google Drive for automated backups with configurable multi-tier retention (daily / weekly / monthly), post-upload integrity verification, and a full suite of Artisan commands — all without replacing your existing backup engine.


Features


Requirements

Package Version
PHP ^8.3 | ^8.4 | ^8.5
Laravel >= 10.0 (supports 10.x, 11.x, 12.x, 13.x+)

Installation

Publish the configuration file:


Google Drive Setup

See docs/google-drive-setup.md for step-by-step instructions on creating a Google Cloud project, enabling the Drive API, and obtaining an OAuth 2.0 refresh token.


Configuration

Add these variables to your .env:

Full configuration reference: docs/configuration.md


Quick Start

Test your connection:

Run your first backup:

List backups on Google Drive:


Database Backups & Supported Drivers

The package natively dumps and restores all major database drivers used in Laravel:

Driver Engine Tool Used
mysql MySQL mysqldump
mariadb MariaDB mysqldump
pgsql PostgreSQL pg_dump
sqlite SQLite sqlite3 (or raw file copy)
sqlsrv SQL Server / Azure SQL sqlcmd

Database Backup Examples

Database Restore


Subfolder Organization (Folder Separation)

By default, backups are uploaded directly into the root folder specified in your .env (GOOGLE_DRIVE_BACKUP_FOLDER_ID or GOOGLE_DRIVE_BACKUP_FOLDER_NAME).

If you want to separate backups into subfolders (e.g. database/, others/):

1. Specify a Subfolder in the Command

2. Auto-organize by Backup Type (--by-type)

3. Listing Backups (Root and Subfolders)


Backing Up Specific Folders or Files (--path)

By default, --files archives your entire application (excluding vendor, node_modules, .git, etc.). If you only need to back up specific folders (such as uploaded images, documents, or media), use the --path option:

Note: If --path is passed, the backup type automatically defaults to files without needing to pass --files explicitly.


Artisan Commands

Command Description
backup:google-drive:refresh-token Interactively generate OAuth refresh token & save to .env
backup:google-drive Create and upload a backup
backup:google-drive:test Test credentials and folder access
backup:google-drive:list List remote backups across root & subfolders (or filter with --subfolder=)
backup:google-drive:clean Apply retention policy and delete expired backups
backup:google-drive:verify Verify remote backup integrity
backup:google-drive:download {id} {destination} Download a backup locally
backup:google-drive:restore-db {id} Download a backup and restore the database (alias: restore)

Use --dry-run with backup:google-drive:clean to preview what would be deleted without making changes.


Scheduling

Add to your routes/console.php (Laravel 11, 12, 13+):


Retention Policy

The retention engine works automatically like Spatie's cleanup strategy — you do not pass dates or intervals on the command line. It reads timestamps on Google Drive and groups backups by type (database vs files) so frequent database backups never delete file backups.

A backup that qualifies for multiple retention tiers (e.g. both daily and weekly) is never deleted until it expires from all applicable tiers.


Events

Listen to backup lifecycle events in your application:

Available events: BackupStarted, BackupCreated, BackupUploaded, BackupVerified, BackupFailed, BackupDeleted, CleanupCompleted.


Testing


Security


Documentation

Topic Link
Installation docs/installation.md
Google Drive Setup docs/google-drive-setup.md
Configuration docs/configuration.md
Retention Policy docs/retention.md
Commands docs/commands.md
Scheduling docs/scheduling.md
Restoration docs/restoration.md
Security docs/security.md
Troubleshooting docs/troubleshooting.md

Compatibility

Package Laravel PHP
2.x 10.x / 11.x / 12.x / 13.x+ 8.3+

License

MIT © Hassan Shahriar — see LICENSE.


All versions of laravel-google-drive-backup with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3 || ^8.4 || ^8.5
google/apiclient Version ^2.15
illuminate/console Version >=10.0
illuminate/filesystem Version >=10.0
illuminate/support Version >=10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hassan-shahriar-1/laravel-google-drive-backup contains the following files

Loading the files please wait ...