TerrePorter / StringBladeCompiler

Render Blade templates from string
MIT License
175 stars 76 forks source link

Laravel 6 version 4 fresh install results in: strpos() expects parameter 1 to be string, array given #68

Closed DanielFortuyn closed 3 years ago

DanielFortuyn commented 3 years ago

After installing multiple versions of this package with Laravel 6, I cannot seem to get it to work.

As stated in the docs I've most recently tried version 4 of this package for laravel 6.

Trying the example:

// string blade template load return view (['template' => '{{$token}}'], ['token' => 'I am the token value']);

I am confronted with the error from the title. Some other issues seem to be open with this error as well, however there they seem to occur on laravel 7

Any ideas on how to patch this?

DanielFortuyn commented 3 years ago

I managed to fix it, something with the name of the service provider and the inclusion in app.php service providers:

StringBladeServiceProvider instead of ViewServiceProvider