-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Closed
Labels
Description
- Laravel Version: 9.36.0
- PHP Version: 8.1.6
- Database Driver & Version: N/A
Description:
Using a view composer with a namespaced wildcard no longer works as of 9.36.0. Likely due to #44487 since it's all about views.
public function boot()
{
$this->loadViewsFrom(resource_path('namespaced'), 'namespaced');
View::composer('namespaced::*', fn ($view) => $view->with('foo', 'bar'));
}{{ $foo }}Undefined variable $foo
Using a complete wildcard still works. View::composer('*', ...)
It's just the namespaced version that doesn't. View::composer('namespace::*', ...)
Steps To Reproduce:
Here's a GitHub repo with the issue reproduced. Link to commit that adds the problematic bits:
https://github.com/jasonvarga/laravel-view-composer-issue/commit/1548cefdba11aa2c660eb2aab6eb5b5fef2d1958
KennedyTedesco