Skip to content

Commit 6d73510

Browse files
Verify blade.compiler is available before registering the component namespace (#120)
* Verify `blade.compiler` is available before registering the component namespace Closes laravel/framework#57078 Laravel 12.29.0 added a dependency on `phiki/phiki`, which has a discoverable service provider to auto-register a Blade's component namespace. In apps that opt out of loading Laravel's `ViewServiceProvider`, the `blade.compiler` binding proxied by the `Blade` façade is not available, which causes an error. Console-only applications can opt out of some providers to reduce size when deployed as PHAR archives. **This PR** - Adds a guard around the Blade's component namespace registration to ensure the `blade.compiler` is bound to the container. * Update src/Adapters/Laravel/PhikiServiceProvider.php Use Facade::resolved() helper Co-authored-by: Mior Muhammad Zaki <crynobone@gmail.com> --------- Co-authored-by: Mior Muhammad Zaki <crynobone@gmail.com>
1 parent acde7e7 commit 6d73510

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Adapters/Laravel/PhikiServiceProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public function register(): void
2222
*/
2323
public function boot(): void
2424
{
25-
Blade::componentNamespace('Phiki\\Adapters\\Laravel\\Components', 'phiki');
25+
Blade::resolved(function ($blade) {
26+
$blade->componentNamespace('Phiki\\Adapters\\Laravel\\Components', 'phiki');
27+
});
2628
}
2729
}

0 commit comments

Comments
 (0)