Skip to content

Commit

Permalink
Fixed view-component namespace bug introduced in Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
code-distortion committed Aug 14, 2024
1 parent 73cd161 commit 4064d7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ jobs:
- dependency-prefer: "prefer-lowest"
dependency-prefer-title: "lowest"
exclude:
- testbench: "^9.0"
php: "8.1"
- testbench: "^9.0"
php: "8.0"
- testbench: "^9.0"
php: "7.4"
- testbench: "^8.0"
php: "8.0"
- testbench: "^8.0"
Expand Down Expand Up @@ -105,9 +111,6 @@ jobs:
- name: "Checkout code"
uses: "actions/checkout@v4"

- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down
3 changes: 3 additions & 0 deletions src/LaravelAutoRegServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public function boot(): void
*
* (This is only used in testing).
*
* @internal
*
* @param Detect $detect The Detect object to use.
* @return void
*/
Expand Down Expand Up @@ -427,6 +429,7 @@ private function registerUserViewComponents(): void
// $this->loadViewComponentsAs($prefix, $fqcns);
// }
foreach ($this->detect->getViewComponentClasses() as [$prefix, $namespace]) {
$namespace = ltrim($namespace, '\\');
Blade::componentNamespace($namespace, $prefix);
}
$this->monitor->incRegCount($type, count($this->detect->getViewComponentClasses()));
Expand Down

0 comments on commit 4064d7a

Please sign in to comment.