PHP code example of dposkachei / laravel-db-snapshots-zip

1. Go to this page and download the library: Download dposkachei/laravel-db-snapshots-zip 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/ */

    

dposkachei / laravel-db-snapshots-zip example snippets


'providers' => [
    // ...
    Spatie\DbSnapshots\DbSnapshotsServiceProvider::class,
];

// ...
'disks' => [
    // ...
    'snapshots' => [
        'driver' => 'local',
        'root' => database_path('snapshots'),
    ],
// ...    

return [

    /**
     * The name of the disk on which the snapshots are stored.
     */
    'disk' => 'snapshots',

    /**
     * The connection to be used to create snapshots. Set this to null
     * to use the default configured in `config/databases.php`
     */
    'default_connection' => null,

    /**
     * The directory where temporary files will be stored.
     */
    'temporary_directory_path' => storage_path('app/laravel-db-snapshots/temp'),

    /*
     * Create dump files that are gzipped
     */
    'compress' => false,
];
bash
php artisan vendor:publish --provider="Spatie\DbSnapshots\DbSnapshotsServiceProvider" --tag="config"
bash
# Creates a snapshot named something like `2017-03-17 14:31`
php artisan snapshot:create
bash
php artisan snapshot:list