PHP code example of mrbohem / larasync

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

    

mrbohem / larasync example snippets


return [
    'db1' => [
        'driver'   => env('LARASYNC_DB1_DRIVER', 'sqlite'),
        'host'     => env('LARASYNC_DB1_HOST'),
        'port'     => env('LARASYNC_DB1_PORT', '3306'),
        'database' => env('LARASYNC_DB1_DATABASE'),
        'username' => env('LARASYNC_DB1_USERNAME'),
        'password' => env('LARASYNC_DB1_PASSWORD', ''),
    ],

    'db2' => [
        'driver'   => env('LARASYNC_DB2_DRIVER', 'mysql'),
        'host'     => env('LARASYNC_DB2_HOST'),
        'port'     => env('LARASYNC_DB2_PORT', '3306'),
        'database' => env('LARASYNC_DB2_DATABASE'),
        'username' => env('LARASYNC_DB2_USERNAME'),
        'password' => env('LARASYNC_DB2_PASSWORD', ''),
    ],

    'ignored_tables' => [
        'sessions',
        'telescope_entries_tags',
        'telescope_entries',
        'telescope_monitoring',
        'pulse_entries',
        'pulse_values',
        'pulse_aggregates',
    ],
];

'ignored_tables' => [
    'sessions',
    'telescope_entries',
    'jobs',
    'failed_jobs',
    // add your tables here...
],

// In routes/web.php
use MrBohem\Larasync\Http\Livewire\SyncDashboard;

Route::get('sync-db', SyncDashboard::class)
    ->middleware(['web', 'auth', 'admin'])  // add your middleware
    ->name('larasync.dashboard');
bash
php artisan vendor:publish --tag="larasync-config"
bash
php artisan vendor:publish --tag="larasync-views"