mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 18:34:04 +00:00
Fix .env loading in development (#799)
* Upgrade vlucas/phpdotenv to ^5.0 `Dotenv::create($paths)` was the syntax for releases before v4 * Remove vlucas/phpdotenv dependency and make it work with newer versions.
This commit is contained in:
parent
cb5f0b1970
commit
31abc3c52c
1 changed files with 5 additions and 1 deletions
|
|
@ -48,8 +48,12 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
||||||
protected function getEnvironmentSetUp($app)
|
protected function getEnvironmentSetUp($app)
|
||||||
{
|
{
|
||||||
if (file_exists(__DIR__ . '/../.env')) {
|
if (file_exists(__DIR__ . '/../.env')) {
|
||||||
|
if (method_exists(\Dotenv\Dotenv::class, 'createImmutable')) {
|
||||||
|
\Dotenv\Dotenv::createImmutable(__DIR__ . '/..')->load();
|
||||||
|
} else {
|
||||||
\Dotenv\Dotenv::create(__DIR__ . '/..')->load();
|
\Dotenv\Dotenv::create(__DIR__ . '/..')->load();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$app['config']->set([
|
$app['config']->set([
|
||||||
'database.default' => 'central',
|
'database.default' => 'central',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue