Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Laravel 4 Basics Laravel Controllers Dynamic styles with Blade

Class 'HTML' not found

Im using the HTML class to fix the url of my js with blade syntax but im getting this error. This is the expression {{ HTML::script('js/vendor/modernizr.js') }}

im using laravel 5.1.

Ty

4 Answers

I found the problem!. I wasn't updating composer from the virtual machine so I just 'vagrant ssh' then in the application folder execute 'composer update' and it works.

Thanks

Thanks, Julian Cortes for posting your question and solution! This post really helped me. Also, I noticed that the order listed in docs http://laravelcollective.com/docs/5.1/html does matter. Don't add anything to your config/app.php until after doing 'composer update'.

To anyone who might happen upon this question. Just use 'asset' it's far easier than adding to composer.json then updating files.

+1 to this. No use learning outdated functions, right?

as you use Laravel 5.1: have you imported/configured the HTML package? If not: check this one http://laravelcollective.com/docs/5.0/html#installation

fyi: Laravel 5.1 does not have this package included on default. The last Laravel version that had this was Laravel 4.2.

Ok. I imported the package but Im still getting this error:

Class 'Collective\Html\HtmlServiceProvider' not found

I configured composer.json and app.php files

Did you configure composer.json and app.php on the Virtual Machine?