lists() method not found
报错信息
BadMethodCallException with message 'Call to undefined method App\User::lists()'
laravel以前的版本用lists方法,而5.3版本开始则弃了这个方法,改用pluck方法,用法一致。
$ids = \App\User::lists('id'); // 改为 $ids = \App\User::pluck('id');
报错信息
BadMethodCallException with message 'Call to undefined method App\User::lists()'
laravel以前的版本用lists方法,而5.3版本开始则弃了这个方法,改用pluck方法,用法一致。
$ids = \App\User::lists('id'); // 改为 $ids = \App\User::pluck('id');