Laravel classloader.php error failed to open stream: No such file or directory

This has happened to me in my Windows 10 machine using a 2 years-old Laravel project from bitbucket. If the composer dump-autoload won't work for you, then the error tells you that a directory is missing in my case, there was no migrations folder inside the database directory.

Solution: Create the migrations folder inside the database directory. You can do this using your IDE, or Windows's File Explorer. If your using Git Bash, cd to your project's database folder then do mkdir migrations to create the missing migrations directory.


Inside your Laravel project folder:

First, update the composer autoloader (details)

composer dumpautoload

then, restart queue (details)

php artisan queue:restart

You have to run composer dumpautoload inside your project folder.