Closed klimov-paul closed 4 years ago
Thanks, @klimov-paul! Could you add a test please?
Blade directive is already tested here: https://github.com/coderello/laravel-shared-data/blob/1.0/tests/SharedDataTest.php#L296
This PR is just a refactoring.
I mean a test for a custom blade directive name.
Test has been added.
Thanks for the contribution!
Blade directive setup has been refactored:
use
Container::extend()
, allowing lazy-load Blade compiler instantiation as well as correct functioning, when Blade package is not installed.Add 'blade.compiler' to
SharedDataServiceProvider::provides()
, ensuring SharedData as well as its Blade directive will be registered correctly once Blade is requested from ContainerAdd the configuration for the Blade directive name, as 'shared' is too common and may conflict with other libraries.