【发布时间】:2021-07-05 08:02:15
【问题描述】:
当我使用php artisan schema:dump --prune 时,它会导致错误。我在我的 database.php 中提到了用户名,但它仍然给出错误。谁能帮帮我?
Undefined variable: username
at vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:41
37▕ */
38▕ public function createConnection($dsn, array $config, array $options)
39▕ {
40▕ [$username, $password] = [
➜ 41▕ $config[$username] ?? null, $config[$password] ?? null,
42▕ ];
43▕
44▕ try
45▕ {
+22 vendor frames
23 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
【问题讨论】:
-
你能告诉我们你的
.env数据库变量和你的数据库配置文件吗? 如果这是生产或其他任何内容,请勿共享您的真实密码,请将其更改为其他任何内容
标签: php laravel database-migration