PHP code example of indeev / laravel-remote-db-sync

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

    

indeev / laravel-remote-db-sync example snippets


'connections' => [
        'sqlite' => [
            'driver' => 'sqlite',
            // ...
        ],

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            // ...
        ],

        'azure' => [ // Our external database connection
            'driver' => 'mysql',
            'host' => env('DB_HOST_AZURE', 'dbservicename.mysql.database.azure.com'),
            'port' => env('DB_PORT_AZURE', '3306'),
            'database' => env('DB_DATABASE_AZURE', ''),
            'username' => env('DB_USERNAME_AZURE', ''),
            'password' => env('DB_PASSWORD_AZURE', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'server_version' => '5.7',
            'modes'  => [
                'ONLY_FULL_GROUP_BY',
                'STRICT_TRANS_TABLES',
                'NO_ZERO_IN_DATE',
                'NO_ZERO_DATE',
                'ERROR_FOR_DIVISION_BY_ZERO',
                'NO_ENGINE_SUBSTITUTION',
            ],
        ],
        // ...
bash
php db:sync_remote azure
bash
php db:sync_remote azure --skipped=cache,log
bash
php db:sync_remote azure --only=customer,customer_settings
bash
php db:sync_remote azure --skipped=cache,log --only_schema=documents,document_metas