Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am able to run "php artisan migrate" fine. I'm able to get all the form input if I use Request::all() but when I try to add the data to my mysql database table I get the below error:

ErrorException in ClassLoader.php line 412:
include(Correct_Path/full-personal/database/migrations/2015_07_06_035501_resume_requesters.php): failed to open stream: No such file or directory

I currently have the form attached to a controller method with the below code:

 $input = Request::all();
    ResumeRequesters::create($input);

I know that I am properly connected to mysql server because I'm able to migrate my migrations.

Any help would be great. Also why did laravel change so many things in Laravel 5?

Thanks

like image 684
Matt Avatar asked Jul 08 '15 06:07

Matt


3 Answers

You have to run composer dumpautoload inside your project folder.

like image 195
Jigs Virani Avatar answered Oct 18 '22 12:10

Jigs Virani


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.

like image 2
codeboye Avatar answered Oct 18 '22 13:10

codeboye


Inside your Laravel project folder:

First, update the composer autoloader (details)

composer dumpautoload

then, restart queue (details)

php artisan queue:restart
like image 7
Yevgeniy Afanasyev Avatar answered Oct 18 '22 13:10

Yevgeniy Afanasyev