PHP code example of jpbgomes / laravel-database-backup

1. Go to this page and download the library: Download jpbgomes/laravel-database-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/ */

    

jpbgomes / laravel-database-backup example snippets


'providers' => [
    Jpbgomes\DatabaseBackup\BackupServiceProvider::class,
]

return [
    'path' => storage_path('app/backups'),
    'recipients' => array_filter(array_map('trim', explode(',', env('BACKUP_EMAIL', '[email protected]')))),
    'zip_password' => env('BACKUP_ZIP_PASSWORD', null),
    '

'    '.env',
    'storage/app/public',
],
bash
php artisan vendor:publish --provider="Jpbgomes\\DatabaseBackup\\BackupServiceProvider" --tag=config
bash
php artisan backup:database
cron
0 4 * * * sudo php /path_to/your_project/artisan backup:database >> /dev/null 2>&1