2015-04-02 58 views
0

在我的Laravel 4.2項目中,我已將我的用戶模型移動到我的應用程序目錄中的新目錄。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" 
    } 
}, 

我還編輯我的應用程序/文件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僞造安裝我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 

有誰知道爲什麼發生這種情況,以及如何解決?

回答

2

我刪除了"app/models",classmap裏面的composer.json文件,它現在的作品。