Laravel 4.2 Composer安装错误:无法扫描"app/models"内部的类 [英] Laravel 4.2 Composer install error: Could not scan for classes inside "app/models"
问题描述
在Laravel 4.2项目中,我已将用户模型移至应用程序目录中的新目录.
In my Laravel 4.2 project I have moved my User model to a new directory within my app directory.
-app/
--Acme/
---Users/
----User.php
然后我删除了app/models目录
I then removed the app/models directory
我将此添加到了composer.json文件
I added this to my composer.json file
"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文件
I also edited my app/auth.php file
/*
|--------------------------------------------------------------------------
| 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存储库,但是我一直收到此错误:
I'm now trying to install my Github repository using Laravel Forge but I keep getting this error:
...
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
有人知道为什么会这样以及如何解决吗?
Does anyone know why this is happening and how to fix?
推荐答案
我从composer.json文件中的classmap
中删除了"app/models",
,现在可以使用了.
I removed "app/models",
from classmap
inside the composer.json file and it now works.
这篇关于Laravel 4.2 Composer安装错误:无法扫描"app/models"内部的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!