Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Aug 26, 2024
1 parent 83cbab2 commit 2b12c28
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Concerns/HandlesRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
*/
trait HandlesRoutes
{
/**
* Indicates if we have made it through the requireApplicationCachedRoutes function.
*
* @var bool
*/
protected $requireApplicationCachedRoutesHasRun = false;

/**
* Setup routes requirements.
*
Expand Down Expand Up @@ -130,6 +137,10 @@ protected function defineCacheRoutes(Closure|string $route, bool $cached = true)
*/
protected function requireApplicationCachedRoutes(Filesystem $files, bool $cached): void
{
if ($this->requireApplicationCachedRoutesHasRun === true) {
return;
}

$this->afterApplicationCreated(function () use ($cached) {
$app = $this->app;

Expand All @@ -152,5 +163,7 @@ protected function requireApplicationCachedRoutes(Filesystem $files, bool $cache

sleep(1);
});

$this->requireApplicationCachedRoutesHasRun = true;
}
}

0 comments on commit 2b12c28

Please sign in to comment.