$connect = true; if ($connect) { session(['connection' => ]); Laravel code example Example: artisan make auth composer require laravel/ui php artisan ui vue --auth