Last Updated: February 25, 2016
· benjaminrh

Solving "Class not found" errors in Laravel 4

If you're new to Laravel 4 and Composer, you might be confused when you start getting errors like this:

PHP Fatal error: Class 'BlaClass' not found in project/vendor/laravel/framework/src/Illuminate/Bla/Bla.php on line xyz

This has to do with Composer's class autoloading, and is very easy to fix. Run composer dump-auto, and then try re-running whatever you were trying to do before, which should now work.

7 Responses
Add your response


Whoa! Working ! cool, I'm just wondering why is this happening?

over 1 year ago ·

Thank you so much, I have been looking quite a while for an solution!

over 1 year ago ·

Would be helpful if you had some suggestions for when dump_autoload doesn't suffice.

I still get Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'View' not found

It's like if Laravel isn't loading the Views class? How to verify that ?

over 1 year ago ·

+1: it'd be helpful if you had some more troubleshooting tips. Autoloading is awesome, except when it doesn't work... then it's power is turned against you.

over 1 year ago ·

If you're in a package and it's still not working, you need to prepend your class name with a \


over 1 year ago ·

wow..! append with \ works for me
i don't know the reason of using '\'. can anyone explain..?

over 1 year ago ·

Because the '\' forces to use the namespace starting from root!

over 1 year ago ·
Filed Under