PHP code example of marshmallow / laravel-database-sync

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

    

marshmallow / laravel-database-sync example snippets


'tables' => [
    'ignore' => [
        'action_events',
        'jobs',
        'telescope_entries',
        'password_resets',
    ],
],

'suites' => [
    'orders' => [
        'orders',
        'order_items',
    ],
],

'multi_tenant' => [
    'landlord' => [
        'database_name' => 'marshmallow_landord',
        'tables' => [
            'ignore' => [
                'action_events',
            ],
        ],
    ],
    'tenants' => [
        'database_names' => [
            'marshmallow_nl' => [
                'tables' => [
                    'ignore' => [
                        'users',
                    ],
                ],
            ],
            'marshmallow_dev',
            'marshmallow_io',
        ],
        'tables' => [
            'ignore' => [
                'logs',
            ],
        ],
    ],
],

test('your test description', function () {
    // Your test code
    expect($result)->toBe($expected);
});
bash
php artisan vendor:publish --tag="database-sync-config"
bash
php artisan db-sync
bash
php artisan db-sync [options]
bash
php artisan db-sync --suite=orders
bash
php artisan db-sync --tenant="marshmallow_nl" --skip-landlord
php artisan db-sync --tenant="marshmallow_nl" --skip-landlord --suite=orders