Laravel prompts "Classnotfound" when executing the migrate operation"

Source: Internet
Author: User
Tags autoload
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.