Could not scan for classes inside "database" which does not appear to be a file nor a folder

**composer require *** 或者 composer dump-autoload 报错

Could not scan for classes inside

原因

"autoload": {
    "classmap": [
        "database/seeds",
        "database/factories"
    ],
 

执行composer install/require更新自动加载,更新执行composer dump-autoload。composer会扫描指定目录下以.php 或.inc 结尾的文件中的 class,生成 class 到指定 file path 的映射,并加入新生成的vendor/composer/autoload_classmap.php 文件中。

发现根目录下的database文件不存在,这时候肯定是报上图这个错了

解决

根目录

  • mkdir database/seeds
  • mkdir database/factories

database 数据库操作相关文件(数据库迁移和数据填充)
Could not scan for classes inside
在正常情况下一般是不需要这个文件,所以平常执行时不会报错的哦

你可能感兴趣的:(Could not scan for classes inside "database" which does not appear to be a file nor a folder)