When Laravel executes the migrate operation, it prompts "Classnotfound" to use Laravel's artisan command tool to execute the migrate operation, prompting "Class not found" errors, 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@iZ94r80gdghZtanteng.me]# php artisan migrate:reset [Symfony\Component\Debug\Exception\FatalThrowableError] Fatalerror: 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@iZ94r80gdghZtanteng.me]# composer dump-autoloadGeneratingautoloadfiles[root@iZ94r80gdghZtanteng.me]# php artisan migrate:resetRolledback: 2016_03_30_104849_create_attachment_tableRolledback: 2016_03_07_094057_create_admins_tableRolledback: 2016_02_22_102354_entrust_setup_tablesRolledback: 2016_02_22_091444_my_ask_anwser_tableRolledback: 2014_10_12_100000_create_password_resets_tableRolledback: 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.