Closed dynabe closed 1 year ago
On the production server it works correctly and env() values are available, but on the local configuration it still does not work.
Okey i found solution on local setup. Console commands can't recognize domain name, so I must add local domain name in bootstrap/app.php
$domainParams = [
'domain_detection_function_web' => function() {
return \Illuminate\Support\Arr::get($_SERVER,'HTTP_HOST') ?? 'local.test';
}
];
$app = new Gecche\Multidomain\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__), dirname(__DIR__) . DIRECTORY_SEPARATOR . 'envs', $domainParams
);
After configuring the package exactly as it says in the instructions, I noticed that inside the invoked command laravel cannot connect to the database. Using Model or DB it returns an error: Access denied for user 'forge'@'localhost' (where 'forge' is the defult value in config/database)