PHP code example of purusottampanta / laravel-gdrive-backup

1. Go to this page and download the library: Download purusottampanta/laravel-gdrive-backup library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

purusottampanta / laravel-gdrive-backup example snippets


// config/backup.php
'enabled' => (bool) env('BACKUP_ENABLED', true),

// config/backup.php
'models' => [
    \App\Models\Consignment::class => 'consignments',
    \App\Models\Box::class => 'boxes',
    \App\Models\Item::class => 'items',
    \App\Models\Location::class => 'locations',
    \App\Models\LabelRequest::class => 'label_requests',
    \App\Models\ThirdPartyDetail::class => 'third_party_details',
    \App\Models\Bill::class => 'bills',
    \App\Models\BillDetail::class => 'bill_details',
],

final class Consignment extends Model implements \Puru\GdriveBackup\Contracts\Backupable
{
    public function backupTableName(): string
    {
        return 'consignments';
    }
}
bash
php artisan vendor:publish --tag=gdrive-backup-config
bash
php artisan vendor:publish --tag=gdrive-backup-migrations
php artisan vendor:publish --tag=gdrive-backup-routes
php artisan migrate
bash
php artisan backup:snapshot [--sync] [--force]
php artisan backup:restore [--date=YYYY-MM-DD] [--force]
php artisan backup:retry-failed [--force]