对于PSR-4自动加载程序用户(composer.json):
在classmap数组内增加App/Services,不要将其包含在自动加载的psr-4对象中。例如;
"autoload": {
"classmap": [
"database/seeds",
"database/factories",
"App/Services"
],
"psr-4": {
"App\\": "app/"
},
"files": [
"app/Helpers/function.php"
]
}
然后运行:
php artisan clear-compiled
composer dump-autoload
php artisan optimize
autoload_psr4.php
和几乎清空autoload_classmap.php
。autoload_classmap.php
。从此时起,您不必再次执行此操作,任何新的迁移都将正常运行。
原文地址:https://stackoverflow.com/questions/30819934/laravel-migrations-class-not-found