Laravel RuntimeException无法扫描“数据库”中的类,这些类似乎不是文件,也不是文件夹

时间:2016-04-26 06:57:34

标签: php laravel-5 composer-php composer.json

我正在尝试运行命令

composer update 

收到此错误消息:

  

[RuntimeException的]   无法扫描“数据库”中看不到的类   是文件也不是文件夹

这是我composer.json中的代码:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "jenssegers/mongodb": "^2.0",

"lucadegasperi/oauth2-server-laravel": "^5.1",

"laravelcollective/html": "5.2.*",

"davibennun/laravel-push-notification": "dev-laravel5"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "symfony/css-selector": "2.8.*|3.0.*",
    "symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ],
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ]
},
"config": {
    "preferred-install": "dist"
}

}

1 个答案:

答案 0 :(得分:3)

我们可以通过在项目根目录下创建database文件夹来解决此问题:<PROJECT_ROOT>/database。如果我们想确保所有内容都可以使用,我们可以删除composer.lock文件并再次运行composer update命令。