Laravel迁移错误,pluck()未定义

时间:2015-08-24 04:16:48

标签: php laravel laravel-5 migration laravel-5.1

我有一个相当简单的迁移,产生以下错误:

[Symfony\Component\Debug\Exception\FatalErrorException]          
Call to undefined method Illuminate\Support\Collection::pluck() 

我可以回滚,但我无法迁移。我正在使用"laravel/framework": "5.1.*@dev",,这是迁移:

public function up()
{
    Schema::table('tutorials', function (Blueprint $table) {
        $table->string('url');
        $table->string('title');
        $table->text('description');
        $table->string('image');
    });
}

pluck方法在Illuminate\Support\Collection中定义,所以我有点茫然。我也运行composer dump。有任何想法吗?

1 个答案:

答案 0 :(得分:0)

考虑使用将评估为5.1.4的laravel版本"5.1.*" 这是因为@dev一直处于开发阶段,并不是所有的功能都可以到位。今天有一件事情会奏效,而第二天则会失败。建议使用稳定版本,然后运行迁移以查看它们是否有效。

相关问题