jenssegers / blade

🔪 A standalone version of Laravel's Blade templating engine for use outside of Laravel.
https://jenssegers.com
816 stars 124 forks source link

Not working with illuminate/view 11.8/11.9/11.10 #74

Open pocketarc opened 3 months ago

pocketarc commented 3 months ago

With illuminate/view 11.7, it works fine. That's the current workaround, just require "illuminate/view": "~11.7.0".

illuminate/view 11.10:

Illuminate\Contracts\Container\BindingResolutionException [ 0 ]: Target class [blade.compiler] does not exist.
vendor/illuminate/container/Container.php:906

illuminate/view 11.9:

Illuminate\Contracts\Container\BindingResolutionException [ 0 ]: Target class [blade.compiler] does not exist.
vendor/illuminate/container/Container.php:906

illuminate/view 11.8:

Call to undefined function Illuminate\View\app()
vendor/illuminate/view/ViewServiceProvider.php:164
sebacarrasco93 commented 3 months ago

It's true, thank you!

Solved issue by doing after install this package:

composer require illuminate/view:11.7.0

xewl commented 3 months ago

They moved away from grabbing the container via app() towards Illuminate/Container (Container::getInstance()), which resulted in this breaking. I'm not sure if adding the Container is necessary, or if we'd have to switch it out with one of our own?

askonomm commented 3 months ago

Should probably add the requirement for illuminate/view into the README at the very least, no? Right now the out-of-box installation experience is a broken library with an odd error.

pocketarc commented 3 months ago

Not even into the README - into the composer.json. Just change the version range allowed for this library. I might even raise a PR for that here, as a temporary measure.

rvm-peercode commented 2 months ago

Same goes for 10.48.11 and up.

MrMarci666 commented 2 weeks ago

Thanks for the issue, please resolve

MahmutHizal commented 2 days ago

Its work for me

ALameLlama commented 2 days ago

I'm on view v10.48.20

ended up doing something like this to get it working

use Jenssegers\Blade\Blade;
use Jenssegers\Blade\Container;
...

        $container = new Container();

        Container::setInstance($container);

        $this->blade = new Blade(
            $this->getView()->getViewsDir(),
            storage_path('views'),
            $container,
        );
MSHADroo commented 17 hours ago

I'm on view v10.48.20

ended up doing something like this to get it working

use Jenssegers\Blade\Blade;
use Jenssegers\Blade\Container;
...

        $container = new Container();

        Container::setInstance($container);

        $this->blade = new Blade(
            $this->getView()->getViewsDir(),
            storage_path('views'),
            $container,
        );

Thanks whis work for me on blade v11.25.0