1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 09: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:
Erik Gaal 2022-02-14 14:31:01 +01:00 committed by GitHub
parent f08e33afd8
commit 9c79267e24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -18,7 +18,6 @@
"stancl/virtualcolumn": "^1.0"
},
"require-dev": {
"vlucas/phpdotenv": "^3.3|^4.0|^5.0",
"laravel/framework": "^6.0|^7.0|^8.0",
"orchestra/testbench-browser-kit": "^4.0|^5.0|^6.0",
"league/flysystem-aws-s3-v3": "~1.0",

View file

@ -48,7 +48,11 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
protected function getEnvironmentSetUp($app)
{
if (file_exists(__DIR__ . '/../.env')) {
\Dotenv\Dotenv::create(__DIR__ . '/..')->load();
if (method_exists(\Dotenv\Dotenv::class, 'createImmutable')) {
\Dotenv\Dotenv::createImmutable(__DIR__ . '/..')->load();
} else {
\Dotenv\Dotenv::create(__DIR__ . '/..')->load();
}
}
$app['config']->set([