Skip to content

Commit

Permalink
fix views name
Browse files Browse the repository at this point in the history
  • Loading branch information
mozex committed Mar 1, 2024
1 parent 46df2a5 commit 8841625
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ModulesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,14 @@ protected function bootViews(): void

AssetType::Views->scout()->collect()
->each(function (array $asset): void {
$this->loadViewsFrom($asset['path'], strtolower($asset['module']));
$this->loadViewsFrom(
path: $asset['path'],
namespace: str($asset['module'])
->replaceMatches('/(?<! )[A-Z]/', '-$0')
->replaceFirst('-', '')
->lower()
->toString()
);
});
}

Expand Down

0 comments on commit 8841625

Please sign in to comment.