Skip to content

Commit b7dddf2

Browse files
authored
Merge pull request #927 from hydephp/update-RealtimeCompiler-InteractsWithLaravel-trait
Update RealtimeCompiler InteractsWithLaravel trait
2 parents a4316e6 + bfada82 commit b7dddf2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/realtime-compiler/src/Concerns/InteractsWithLaravel.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
use Illuminate\Foundation\Application;
77

88
/**
9-
* Provides methods to interact with the Laravel (Hyde)
10-
* application instance. This is needed to bootstrap
11-
* core Hyde services, for example page compilers.
9+
* Provides methods to interact with the Laravel (Hyde) application instance.
10+
* This is needed to bootstrap core Hyde services, for example page compilers.
11+
*
12+
* The application is lazy-loaded and only booted when necessary as it takes ~80ms.
13+
* This is so routes that don't need the application don't suffer the performance hit.
1214
*/
1315
trait InteractsWithLaravel
1416
{
1517
protected Application $laravel;
1618

1719
protected function createApplication(): void
1820
{
19-
$this->laravel = require_once BASE_PATH.'/app/bootstrap.php';
21+
$this->laravel = require BASE_PATH.'/app/bootstrap.php';
2022
}
2123

2224
protected function bootApplication(): void

0 commit comments

Comments
 (0)