Retrieves the values from a single column in collection

@param  string $key

@return static
977460
public function column($key)
    {
        $result = array_column($this->all(), $key);

        if (empty($result)) {
            $this->each(function ($item) use (&$result, $key) {
                array_push($result, $item->{$key});
            });
        }

        return new static($result);
    }
1077124
public function get(string $key)
    {
        $slug = $this->splitKey($key);

        if (is_string($slug)) {
            if (isset($this[$slug])) {
                return $this[$slug];
            }
            return null;
        }

        $array = $this->toArray();

        foreach ($slug as $search) {
            if (isset($array[$search])) {
                $array = $array[$search];
            } else {
                return;
            }
        }

        return $array;
    }
504043
public function indexBy($key): self
    {
        // init
        $results = [];

        foreach ($this->getGenerator() as $a) {
            if (\array_key_exists($key, $a) === true) {
                $results[$a[$key]] = $a;
            }
        }

        return static::create(
            $results,
            $this->iteratorClass,
            false
        );
    }
1316169
public static function get($key)
    {
        $key = strtoupper($key);

        $list = static::loadConstants();

        if(array_key_exists($key,$list))
            return static::loadConstants()[$key];

        if(static::exist($key))
            return $key;

        // Throw exception.
        static::invalidType();
    }
1278768
public static function &get($key)
    {
        self::startIf();
        if (isset($_SESSION[$key])) {
            return $_SESSION[$key];
        } else {
            $val = null;
            return $val;
        }
    }
556038
public function getRelationValue($key)
    {
        $relation = parent::getRelationValue($key);

        if ($relation instanceof Collection) {
            $relation->each(function ($model) {
                $this->setRelationConnection($model);
            });

            return $relation;
        }

        $this->setRelationConnection($relation);

        return $relation;
    }
1188536
public function get(?string $key = null)
    {
        $key = $this->constructKey($key);

        if (is_null($key)) {
            $array = $this->toArray();

            return $this->count() == 1 ? end($array) : $array;
        }

        return $this->parseKey($key, function ($part, $result) {
            if (isset($result[$part])) {
                return $result[$part];
            }
        });
    }
1064484
public function get($key)
    {
        if (! isset($this->storage[$key])) {
            return;
        }

        $item = $this->storage[$key];

        $expiresAt = $item['expiresAt'] ?? 0;

        if ($expiresAt !== 0 && $this->currentTime() > $expiresAt) {
            $this->forget($key);

            return;
        }

        return $item['value'];
    }
949543
public function get($key)
    {
        $value = $this->redis->get($this->decorateKey($key));

        return $value ? Collection::make($value) : new Collection();
    }
357501
private function getNestedValueByKey($key)
    {
        if (isset($this->nestedKeyCache[$key])) {
            return $this->nestedKeyCache[$key];
        }

        // Check to see if this is targeting an instance of ArrayContainer and grab it from the nested container
        $keyParts = explode('.', $key);
        if ($this->get($keyParts[0]) instanceof self && $arrayContainer = $this->get($keyParts[0])) {
            array_shift($keyParts);
            /* @var ArrayContainer $arrayContainer */
            $value = $arrayContainer->get(implode('.', $keyParts));
        } else {
            $value = $this->items;
            foreach (explode('.', $key) as $keyPart) {
                if ((! is_array($value) || ! $value instanceof self)) {
                    if (is_object($value) && method_exists($value, 'arrayAccessByKey')) {
                        if ($value = $value->arrayAccessByKey($keyPart)) {
                            break;
                        } else {
                            return null;
                        }
                    }
                }

                if (! isset($value[$keyPart])) {
                    return null;
                }

                if (is_array($value[$keyPart]) && ! array_key_exists($keyPart, $value)) {
                    return null;
                }
                $value = $value[$keyPart];
            }
        }

        $this->nestedKeyCache[$key] = $value;

        return $value;
    }
1157099
public function pluck(string $key): ArrayCollection
    {
        return $this->map(function ($value) use ($key) {
            return $value[$key] ?? null;
        });
    }
1280790
public function getValueStored($key)
    {
        if (isset($this->storedValues[$key])) {
            return $this->storedValues[$key];
        } else {
            return null;
        }
    }
39879
public function get($key) {
        if (!is_array($key)) {
            $key = array('key' => $key);
        }

        $result = $this->collection->findOne($key);
        if ($result === null || !array_key_exists('data', $result)) {
            return false;
        }
        $data = @unserialize($result['data']);
        return $data;
    }
399360
public function offsetGet($key)
    {
        $result = array_get($this->items, $key);

        if (is_array($result))
            return new static($result);

        return $result;
    }
113460
public function get($key)
    {
        if (isset($this->values[$key])) {
            return $this->values[$key]->toArray();
        }

        return array();
    }
547580
public function offsetGet($key)
    {
        if (($index = $this->keysIndices[self::keyString($key)] ?? null) === null) {
            return null;
        }

        return $this->values[$index];
    }
1358760
protected function getValue($key)
    {
        foreach ($this->bags as $bag) {
            if (!$bag->has($key)) {
                continue;
            }
            
            if ($bag instanceof ParameterBag) {
                $value = $bag->get($key);
            }
            elseif ($bag instanceof HeaderBag) {
                // when header is presented only once, string value is returned, otherwise, array value is returned
                $value = $bag->get($key, null, false);
                if (is_array($value)) {
                    if (count($value) == 1) {
                        $value = $value[0];
                    }
                    elseif (count($value) == 0) {
                        $value = null;
                    }
                    /** @noinspection PhpStatementHasEmptyBodyInspection */
                    else {
                        // $value = $value;
                    }
                }
            }
            else {
                throw new \LogicException("Bag type invalid!");
            }
            
            return $value;
        }
        
        return null;
    }