TerrePorter / StringBladeCompiler

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

Class view does not exist #38

Closed Dmk88 closed 2 years ago

Dmk88 commented 6 years ago

"wpb/string-blade-compiler": "^3.5.5", Laravel 5.5 Change app.php: remove Illuminate\View\ViewServiceProvider::class, and add Wpb\String_Blade_Compiler\ViewServiceProvider::class, result: Class view does not exist

jayenne commented 6 years ago

me too

pyrochlore commented 6 years ago

me too. any solution?

pyrochlore commented 6 years ago

Hi, I have fixed the problem.

For those who met the same problem, I found the problem is not from this package, but is from other package calling loadViewsFrom too early.

In my case, I have VoyagerHooksServiceProvider calling loadViewsFrom function in its function register, but at that time the app['view'] is not ready to use. Functions like loadViewsFrom should be put into boot() instead of register() to make sure all the service providers are registered.

Happy coding.