方法列表不存在

Method lists does not exist

我正在尝试使用这种方法从数据库填充我的 select 框

{!! Form::select('worktypes', $worktypes->lists('name'), null, ['class' => 'col-md-2 form-control', 'required', 'placeholder' => '--auswählen']) !!}

但是 Laravel 5.3

中不再存在方法 lists()

还有其他方法吗?

我刚刚发现:

方法 lists() 在 Laravel v5.2^

中已弃用

重命名为:

pluck()

方法签名保持不变。

Laravel Documentation

在 link

上搜索 Deprecations

更新: 以防万一 link 死亡或页面更改,这是上面的内容:

Deprecations The following features are deprecated in 5.2 and will be removed in the 5.3 release in June 2016:

The lists method on the Collection, query builder and Eloquent query builder objects has been renamed to pluck. The method signature remains the same.