The Classnotfound prompt is that the class is not found. If the corresponding class is not found, we can check whether there is a problem with the configuration or call, next, let's take a look at the solution to the "Classnotfound" prompt for Laravel to execute the migrate operation, as shown below. The prompt "Class not found" is that the Class is not found. If the corresponding Class is not found, we can check whether there is a problem with the configuration or call, next, let's take a look at the solution to the "Class not found" prompt for Laravel to execute the migrate operation, as shown below.
Script ec (2); script
If you use Laravel's artisan command tool to execute the migrate operation, a "Class not found" error is prompted, but this migrate Class file exists. If you encounter this problem, run the following composer dump-autoload command to solve the problem.
The first error is as follows:
[Root @ iZ94r80gdghZ tanteng. me] # php artisan migrate: reset
[Symfony \ Component \ Debug \ Exception \ FatalThrowableError]
Fatal error: Class 'createattachmenttable' not found
No matter what the migrate operation is executed, the system prompts that the class cannot be found.
After you run composer dump-autoload, run the migrate operation again.
[Root @ iZ94r80gdghZ tanteng. me] # composer dump-autoload
Generating autoload files
[Root @ iZ94r80gdghZ tanteng. me] # php artisan migrate: reset
Rolled back: 2016_03_30_104849_create_attachment_table
Rolled back: 2016_03_07_094057_create_admins_table
Rolled back: 2016_02_22_102354_entrust_setup_tables
Rolled back: 2016_02_22_091444_my_ask_anwser_table
Rolled back: 2014_10_12_100000_create_password_resets_table
Rolled back: 2014_10_12_000000_create_users_table
Role of composer dump-autoload
The function of the composer dump-autoload command is to optimize automatic loading. When the code is deployed to the production environment or the class files in the automatically loaded folder are deleted, You need to execute the automatic loading command, in this way, automatic loading will take effect.