PHP code example of intrepidws / laravel-ssh-tunnel-fixed

1. Go to this page and download the library: Download intrepidws/laravel-ssh-tunnel-fixed 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/ */

    

intrepidws / laravel-ssh-tunnel-fixed example snippets


$app->register(IntrepidWS\Tunneler\TunnelerServiceProvider::class);

IntrepidWS\Tunneler\TunnelerServiceProvider::class,

'mysql_tunnel' => [
    'driver'    => 'mysql',
    'host'      => env('TUNNELER_LOCAL_ADDRESS'),
    'port'      => env('TUNNELER_LOCAL_PORT'),
    'database'  => env('DB_DATABASE'),
    'username'  => env('DB_USERNAME'),
    'password'  => env('DB_PASSWORD'),
    'charset'   => env('DB_CHARSET', 'utf8'),
    'collation' => env('DB_COLLATION', 'utf8_unicode_ci'),
    'prefix'    => env('DB_PREFIX', ''),
    'timezone'  => env('DB_TIMEZONE', '+00:00'),
    'strict'    => env('DB_STRICT_MODE', false),
],

protected function schedule(Schedule $schedule)
{
    $schedule->command('tunneler:activate')->everyFiveMinutes();
}

$app->get('/mysql_tunnel', function () use ($app) {
    dispatch(new STS\Tunneler\Jobs\CreateTunnel());

    $users = DB::connection('mysql_tunnel')
            ->table('users')
            ->get();

    dd($users);
});


php artisan tunneler:activate