Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Oct 6, 2022
1 parent e90aae8 commit d388413
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/RootServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function register(): void
}

$this->app->booted(static function (Application $app): void {
if ((! $app->environment('testing') && $app->runningInConsole()) || Root::shouldRun($app['request'])) {
if ($app->runningInConsole() || Root::shouldRun($app['request'])) {
Root::run($app['request']);
}
});
Expand Down
6 changes: 4 additions & 2 deletions src/Support/Facades/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ public static function register(string $key, Item $item): void

$request = RootRequest::createFrom(static::getFacadeApplication()['request']);

static::getFacadeRoot()->put($key, $item);
if (! static::getFacadeRoot()->has($key)) {
static::getFacadeRoot()->put($key, $item);

$item->registered($request);
$item->registered($request);
}
}

/**
Expand Down

0 comments on commit d388413

Please sign in to comment.