微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

迁移文件后找不到Laravel类

我将Laravel Stapler用于图像目的,并且在迁移新表后,我尝试使用artisan migration:refresh之后再显示错误

[Symfony\Component\Debug\Exception\FatalErrorException]
Class ‘AddPhotoFieldsToStaffTable’ not found

但是,在尝试–refresh之前,我可以看到我的迁移文件夹中的文件并使用PHP artisan migration,文件已成功迁移!

生成文件是:

class AddPhotoFieldsToStaffTable extends Migration {

    /**
     * Make changes to the table.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('staff', function(Blueprint $table) {

            $table->string('photo_file_name')->nullable();
            $table->integer('photo_file_size')->nullable()->after('photo_file_name');
            $table->string('photo_content_type')->nullable()->after('photo_file_size');
            $table->timestamp('photo_updated_at')->nullable()->after('photo_content_type');

        });

    }

    /**
     * Revert the changes to the table.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('staff', function(Blueprint $table) {

            $table->dropColumn('photo_file_name');
            $table->dropColumn('photo_file_size');
            $table->dropColumn('photo_content_type');
            $table->dropColumn('photo_updated_at');

        });
    }

}

任何帮助将不胜感激.

解决方法:

使用作曲家dumpautoload解决了这个问题.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐