Skip to content

Commit

Permalink
fix routes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Dec 17, 2024
1 parent 45734bc commit 71a90db
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Providers/AddonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,12 @@ protected function bootPublishables()

protected function bootRoutes()
{
if (! $this->shouldBootRootItems()) {
return $this;
}

$directory = $this->getAddon()->directory();

$web = Arr::get(
array: $this->routes,
key: 'web',
default: $this->app['files']->exists($path = $directory.'routes/web.php') ? $path : null
default: $this->shouldBootRootItems() && $this->app['files']->exists($path = $directory.'routes/web.php') ? $path : null
);

if ($web) {
Expand All @@ -546,7 +542,7 @@ protected function bootRoutes()
$cp = Arr::get(
array: $this->routes,
key: 'cp',
default: $this->app['files']->exists($path = $directory.'routes/cp.php') ? $path : null
default: $this->shouldBootRootItems() && $this->app['files']->exists($path = $directory.'routes/cp.php') ? $path : null
);

if ($cp) {
Expand All @@ -556,7 +552,7 @@ protected function bootRoutes()
$actions = Arr::get(
array: $this->routes,
key: 'actions',
default: $this->app['files']->exists($path = $directory.'routes/actions.php') ? $path : null
default: $this->shouldBootRootItems() && $this->app['files']->exists($path = $directory.'routes/actions.php') ? $path : null
);

if ($actions) {
Expand Down

0 comments on commit 71a90db

Please sign in to comment.