【发布时间】:2015-06-08 01:59:11
【问题描述】:
在我的 Laravel 4.2 项目中,我已将我的用户模型移动到我的应用程序目录中的一个新目录中。
-app/
--Acme/
---Users/
----User.php
然后我删除了 app/models 目录
我将此添加到我的 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' => 'app\Acme\Users\User',
然后我跑了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
有谁知道为什么会发生这种情况以及如何解决?
【问题讨论】: