rcrowe / TwigBridge

Give the power of Twig to Laravel
MIT License
894 stars 168 forks source link

View::composer not working v.0.14.0 #425

Closed mygomel closed 2 years ago

mygomel commented 2 years ago

I am using the construct in ServiceProvider:

        View::composer(['blocks.MetaTags.MetaTags__Meta', 'blocks.MetaTags.MetaTags__Script'], function (ViewTemplate $view) {
            $view->with([
                'assetTimestamp' => ServiceHelper::getAssetDate(),
            ]);
        });

After updating from v0.12.4 to v0.14.0 View::composer no longer supplies variables to the template

daanadriaan commented 2 years ago

Same here! @mygomel Did you find a work around already?

EgorGruzdev commented 2 years ago

You need to enable the extension for it to work: \TwigBridge\Extension\Laravel\Event::class

mygomel commented 2 years ago

You need to enable the extension for it to work: \TwigBridge\Extension\Laravel\Event::class Thanks, it helped, the config is different in the new version, you need to make changes when updating