Skip to content

Commit 1f67bf2

Browse files
committed
Fix installation broken Dotenv on Laravel 5.8
Dotenv on Laravel 5.8 was bumped to a new version which changes the bootstrap process. This BC fix allows for both installs to be used. Fixes #614
1 parent 98eccfd commit 1f67bf2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Console/DuskCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,14 @@ protected function restoreEnvironment()
209209
*/
210210
protected function refreshEnvironment()
211211
{
212-
(new Dotenv(base_path()))->overload();
212+
// BC fix to support Dotenv ^2.2
213+
if (! method_exists(Dotenv::class, 'create')) {
214+
(new Dotenv(base_path()))->overload();
215+
216+
return;
217+
}
218+
219+
Dotenv::create(base_path())->overload();
213220
}
214221

215222
/**

0 commit comments

Comments
 (0)