V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ChenKe
V2EX  ›  程序员

Laravel 框架:如果运行迁移文件出现 Class 'AddDealerToUsersTable' not found 时候解决办法

  •  
  •   ChenKe · 2016-07-28 12:05:51 +08:00 · 1831 次点击
    这是一个创建于 2843 天前的主题,其中的信息可能已经有所发展或是发生改变。
    [Symfony\Component\Debug\Exception\FatalThrowableError]
    Class 'AddDealerToUsersTable' not found

    如果运行迁移文件,出现某类找不到,输入下面的命令就可以搞定

    sudo composer dump-autoload
    7 条回复    2016-07-28 15:09:36 +08:00
    Clarencep
        1
    Clarencep  
       2016-07-28 12:11:05 +08:00
    难道你不是运行`php artisan make:migration`创建的迁移文件?而是纯手工创建的?
    iVanilla
        2
    iVanilla  
       2016-07-28 12:11:51 +08:00
    这个错误没遇到过,但偶尔遇到其他类型的错误。
    ChenKe
        3
    ChenKe  
    OP
       2016-07-28 12:59:38 +08:00
    @Clarencep 你可以手工试试
    leetom
        4
    leetom  
       2016-07-28 13:02:35 +08:00
    @Clarencep Pull 下来的就需要手动 dump-autoload
    Clarencep
        5
    Clarencep  
       2016-07-28 13:04:25 +08:00
    额, pull 下来,好吧, migrations 一般我们项目组只有我来加。
    laravel
        6
    laravel  
       2016-07-28 13:42:05 +08:00
    需要重新生成 autoload.php 文件 要不然自动加载找不到类
    ChenKe
        7
    ChenKe  
    OP
       2016-07-28 15:09:36 +08:00
    @laravel 那也不至于频繁的丢失啊 不知道为什么 动不动就找不到

    把这个 问题 扔这里 等有人搜索到就可以解决问题了

    哦也
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   975 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:08 · PVG 05:08 · LAX 14:08 · JFK 17:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.