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.