Skip to content

Commit f27fa00

Browse files
Mahmoud Abdelgawadmmabdelgawadtaylorotwell
authored
[8.x] Support database_url for php artisan db command (#37064)
* handle database url * Update DbCommand.php Co-authored-by: mmabdelgawad <mahmoud.abdelgawad@izam.co> Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 03c0525 commit f27fa00

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Console/DbCommand.php

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Illuminate\Database\Console;
44

55
use Illuminate\Console\Command;
6+
use Illuminate\Support\ConfigurationUrlParser;
67
use Symfony\Component\Process\Process;
78
use UnexpectedValueException;
89

@@ -57,6 +58,10 @@ public function getConnection()
5758
throw new UnexpectedValueException("Invalid database connection [{$db}].");
5859
}
5960

61+
if (! empty($connection['url'])) {
62+
$connection = (new ConfigurationUrlParser)->parseConfiguration($connection);
63+
}
64+
6065
return $connection;
6166
}
6267

0 commit comments

Comments
 (0)