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

Laravel migrate rollback 报错

  •  
  •   kevinroot ·
    adin283 · 2014-03-27 23:04:43 +08:00 · 4120 次点击
    这是一个创建于 3895 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ➜ /Library/WebServer/Documents/laravel >php artisan migrate:rollback
    PHP Fatal error: Class 'AddAuthors' not found in /Library/WebServer/Documents/laravel/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php on line 297
    PHP Stack trace:
    PHP 1. {main}() /Library/WebServer/Documents/laravel/artisan:0
    PHP 2. Symfony\Component\Console\Application->run() /Library/WebServer/Documents/laravel/artisan:59
    PHP 3. Symfony\Component\Console\Application->doRun() /Library/WebServer/Documents/laravel/vendor/symfony/console/Symfony/Component/Console/Application.php:121
    PHP 4. Symfony\Component\Console\Application->doRunCommand() /Library/WebServer/Documents/laravel/vendor/symfony/console/Symfony/Component/Console/Application.php:191
    PHP 5. Illuminate\Console\Command->run() /Library/WebServer/Documents/laravel/vendor/symfony/console/Symfony/Component/Console/Application.php:892
    PHP 6. Symfony\Component\Console\Command\Command->run() /Library/WebServer/Documents/laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php:96
    PHP 7. Illuminate\Console\Command->execute() /Library/WebServer/Documents/laravel/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:241
    PHP 8. Illuminate\Database\Console\Migrations\RollbackCommand->fire() /Library/WebServer/Documents/laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php:108
    PHP 9. Illuminate\Database\Migrations\Migrator->rollback() /Library/WebServer/Documents/laravel/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php:54
    PHP 10. Illuminate\Database\Migrations\Migrator->runDown() /Library/WebServer/Documents/laravel/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:170
    PHP 11. Illuminate\Database\Migrations\Migrator->resolve() /Library/WebServer/Documents/laravel/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:190
    {"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'AddAuthors' not found","file":"\/Library\/WebServer\/Documents\/laravel\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Migrations\/Migrator.php","line":297}}{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'AddAuthors' not found","file":"\/Library\/WebServer\/Documents\/laravel\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Migrations\/Migrator.php","line":297}}%
    4 条回复    1970-01-01 08:00:00 +08:00
    bearcat001
        1
    bearcat001  
       2014-03-28 08:41:54 +08:00
    楼主多看提示,这不是第一句就写了没有找到AddAuthors类么
    1. 你migrate下那个文件中up/down方法里用了这个类,但是这个类不在自动加载路径中
    2. 如果是model名称,一般是单数AddAuthor
    Part
        2
    Part  
       2014-03-28 09:30:00 +08:00   ❤️ 1
    composer dump-autoload
    kevinroot
        4
    kevinroot  
    OP
       2014-03-28 11:06:14 +08:00
    @Part 可以了 非常感谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3342 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 12:27 · PVG 20:27 · LAX 04:27 · JFK 07:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.