7 project lets say im working with locahost i want if the url is http://localhost/project1 then the database will be project1 and if the link is http://localhost/project2 the database will be project2 ect any help here thanks a lot i tried to do this inside database.php
$url = $_SERVER['REQUEST_URI'];
$url = explode('/',$url);
$url = $url[1];
'mysql' => [
'driver' => 'mysql',
'host' => 'localhost',
'port' => '3306',
'database' => $url,
'username' => 'root',
'password' =>'secrit',
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
its working if i only enter the main path of laravel project thanks a lot