PHP code example of drands / deployer-sync

1. Go to this page and download the library: Download drands/deployer-sync 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/ */

    

drands / deployer-sync example snippets


return [
    'products' => 'keep',     // dumped as is: only for tables without columns that look personal
    'sessions' => 'exclude',  // not dumped: the table is empty locally
    'users' => [              // anonymized: every column must be declared
        'id' => 'keep',
        'name' => 'name',
        'email' => 'unique_email',
        'password' => 'password',
        'remember_token' => null,
        'created_at' => 'keep',
        'updated_at' => 'keep',
    ],
];

return [
    'local_admin' => [
        'model' => \App\Models\Admin::class,
        'ask_defaults' => env('SYNC_ADMIN_ASK_DEFAULTS', true),
        'id' => 1,
        'fields' => [                       // asked for, with their defaults
            'first_name' => env('SYNC_ADMIN_FIRST_NAME'),
            'last_name' => env('SYNC_ADMIN_LAST_NAME'),
            'email' => env('SYNC_ADMIN_EMAIL'),
            'password' => env('SYNC_ADMIN_PASSWORD'), // hashed
        ],
        'attributes' => ['is_admin' => true],          // forced on the restored admin
        'reset' => ['remember_token', 'two_factor_secret'], // set to NULL
    ],
];

// config/deployer-sync.php
return [
    'keep_local_paths' => ['imports'],
];
yml
local_php_path: php