pluck() 공개 메소드

Get an array with the values of a given column.
public pluck ( string $column, string | null $key = null ) : Collection
$column string
$key string | null
리턴 Illuminate\Support\Collection
예제 #1
0
 public function pluck($value, $key = null)
 {
     $this->newQuery();
     $lists = $this->query->pluck($value, $key);
     if (is_array($lists)) {
         return $lists;
     }
     return $lists->all();
 }
예제 #2
0
 /**
  * @param  string $value
  * @param  string $key
  * @return array
  */
 public function pluck($value, $key = null)
 {
     $this->applyCriteria();
     $lists = $this->model->pluck($value, $key);
     if (is_array($lists)) {
         return $lists;
     }
     return $lists->all();
 }
예제 #3
0
 /**
  * Get a single column's value from the first result of a query.
  * 
  * This is an alias for the "value" method.
  *
  * @param string $column
  * @return mixed 
  * @deprecated since version 5.1.
  * @static 
  */
 public static function pluck($column)
 {
     return \Illuminate\Database\Eloquent\Builder::pluck($column);
 }
 /**
  * @param string|int $value
  * @param string     $key
  *
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function getList($value, $key = 'id')
 {
     return $this->model->pluck($value, $key);
 }