PHP code example of usmonaliyev / laravel-db-connection-resolver

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

    

usmonaliyev / laravel-db-connection-resolver example snippets

bash
php artisan vendor:publish --provider="Usmonaliyev\DbConnectionResolver\DbConnectionResolverServiceProvider"
bash
php artisan migrate
bash
use Usmonaliyev\DbConnectionResolver\Middleware\ConnectionResolverMiddleware; 
 
Route::middleware([ConnectionResolverMiddleware::class])->group(function () {
    
    Route::get('/', function () {
        //
    });
});