在我的Laravel 4.2项目中,我已将我的用户模型移动到我的应用程序目录中的一个新目录中。
-app/
--Acme/
---Users/
----User.php
然后我删除了应用程序/模型目录
我把它添加到我的composer.json文件中
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php",
"app/Acme/adminHelpers.php"
],
"files": [
"app/Acme/helpers.php",
"app/Acme/adminHelpers.php"
],
"psr-4": {
"Acme\": "app/Acme"
}
},
我还编辑了我的app/auth.php文件
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
'model' => 'appAcmeUsersUser',
然后我运行了composer dump-autoload
我现在正试图使用Laravel Forge安装我的Github存储库,但我一直收到这个错误:
...
Writing lock file
Generating autoload files
[RuntimeException]
Could not scan for classes inside "app/models" which does not appear to be a file nor a folder
有人知道为什么会发生这种情况以及如何解决吗?
我在composer.json文件中从classmap
中删除了"app/models",
,现在它可以工作了。