Laravel Perform migrate operation prompt "Class not found" how to solve

Source: Internet
Author: User
Tags autoload reset

Use the Laravel Artisan command tool to perform a migrate operation that prompts for a "class not found" error, but this migrate class file exists and, in the event of this problem, executes the following composer Dump-autoload, Problems are solved.

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

The class cannot be found, regardless of what action is performed migrate.

After performing composer Dump-autoload, run the migrate operation again, all normal.

[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
The role of composer Dump-autoload

The composer Dump-autoload command is optimized for automatic loading, when the code is deployed to the production environment, or the class files in the Automatically loaded folder are added, and the automatic load command is required to perform automatic loading to work.

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.