44
votes

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

5
Tried composer dumpautoload. ?Sulthan Allaudeen
It is preferred if you can post separate questions instead of combining your questions into one. That way, it helps the people answering your question and also others hunting for at least one of your questions. Thanks!Matt

5 Answers

155
votes

You have to run composer dumpautoload inside your project folder.

4
votes

Inside your Laravel project folder:

First, update the composer autoloader (details)

composer dumpautoload

then, restart queue (details)

php artisan queue:restart
2
votes

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.

1
votes

ClassLoader.php Load the given class file into Laravel. Similar errors are due to failure to autoload new classes.

composer dump-autoload

composer dump-autoload regenerates the list of all classes that need to be included in the project (autoload_classmap.php). It won’t download anything.

When to use: When you have a new class inside your project, Run it from the project root.

0
votes

One of the reason of this kind of error is that when you deleted something from your project like login module then auto-file-loader does contain that file information when you deleted something , so therefore if you are deleting something , then after deleting something from your project,so shoude run command composer dumpautoload then it show following logs Generating optimized autoload files

@php artisan package:discover --ansi Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: laravel/ui Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. Generated optimized autoload files containing 4334 classes you can run your project again PS D:\laravel\myApp> php artisan serve