Get only certain attributes.

@param string[]|string $keys,...

@return array
491827
public function only($keys)
    {
        $keys = is_array($keys) ? $keys : func_get_args();

        return array_only($this->parameters, $keys);
    }
619405
public function mget(array $keys): array
    {
        $result = $this->getFactory()->getRedisClient()->mget($keys);

        return $this->getFactory()->createListConverter()->convertFromList(
            $result
        );
    }
1068031
public function allParamsFor(array $keys): array
    {
        $params = [];
        foreach ($keys as $key) {
            if (isset($this->params[$key])) {
                $params[$key] = $this->params[$key];
            }
        }

        return $params;
    }
296917
public function only($keys)
    {
        $keys = is_array($keys) ? $keys : func_get_args();

        $results = [];
        foreach ($keys as $key) {
            $results = array_merge_recursive($results, $this->buildArray(explode('.', $key), $this->get($key)));
        }

        return $results;
    }
1070481
public function except($keys)
    {
        $keys = is_array($keys) ? $keys : func_get_args();

        $results = $this->all();

        array_forget($results, $keys);

        return $results;
    }
326821
public static function getSubArrayFromArrayByKeys(array $array, array $keys)
    {
        $result = [];

        foreach ($keys as $key) {
            if (array_key_exists($key, $array)) {
                $result[$key] = $array[$key];
            }
        }

        return $result;
    }
495211
protected function getKeyIDs($keys)
    {
        // Force iterator to array with simple temp array
        $map = [];
        foreach ($keys as $key) {
            $map[] = $this->getKeyID($key);
        }
        return $map;
    }
463891
public function pick($keys = null)
    {
        if ($keys === null) {
            $attributes = static::getMapper()->getAttributes();
            $keys = [];

            foreach ($attributes as $key => $attribute) {
                if (!$attribute['protected']) {
                    $keys[] = $key;
                }
            }
        } else {
            $keys = is_array($keys) ? $keys : func_get_args();
        }

        $values = [];
        foreach ($keys as $key) {
            if (array_key_exists($key, $this->values)) {
                $values[$key] = $this->get($key);
            }
        }

        return $values;
    }
1175752
public function only($keys)
    {
        if (is_null($keys)) {
            return new static($this->items);
        }

        return new static(array_intersect_key($this->items, array_flip((array)$keys)));
    }
146274
public function getMerchantFields(array $keys)
    {
        $fields = [];
        foreach ($keys as $key) {
            $fields[$key] = $this->data[$key];
        }

        return $fields;
    }
847343
public function mget(array $keys)
    {
        return array_map(
            function ($value) {
                return $value !== false ? $value : null;
            }, $this->client->mget($keys)
        );
    }
801743
public function many(array $keys)
    {
        $prefixedKeys = array_map(function ($key) {
            return $this->prefix.$key;
        }, $keys);

        $response = $this->dynamo->batchGetItem([
            'RequestItems' => [
                $this->table => [
                    'ConsistentRead' => false,
                    'Keys' => collect($prefixedKeys)->map(function ($key) {
                        return [
                            $this->keyAttribute => [
                                'S' => $key,
                            ],
                        ];
                    })->all(),
                ],
            ],
        ]);

        $now = Carbon::now();

        return array_merge(collect(array_flip($keys))->map(function () {
        })->all(), collect($response['Responses'][$this->table])->mapWithKeys(function ($response) use ($now) {
            if ($this->isExpired($response, $now)) {
                $value = null;
            } else {
                $value = $this->unserialize(
                    $response[$this->valueAttribute]['S'] ??
                    $response[$this->valueAttribute]['N'] ??
                    null
                );
            }

            return [Str::replaceFirst($this->prefix, '', $response[$this->keyAttribute]['S']) => $value];
        })->all());
    }
469436
public function getMany(...$keys)
    {
        $ret = [];

        foreach ($this->normalizeKeys($keys) as $key) {
            if ($this->has($key)) {
                $ret[$key] = $this->proxy->{$key};
            }
        }

        return $ret;
    }
1119654
public function flatKeys(array $keys): array
    {
        $this->search = $keys;
        return $this->flatCollection($this->collection->toArray());
    }
960249
public function only($keys)
	{
		$keys = is_array($keys) ? $keys : func_get_args();

		return array_only($this->input(), $keys) + array_fill_keys($keys, null);
	}
71548
protected function getArrayAttributeByKey($key)
    {
        return isset($this->attributes[$key]) ?
                    $this->fromJson($this->attributes[$key]) : [];
    }
440923
public function normalizeKeys($keys)
    {
        if ($keys === true) {
            $keys = $this->keys();
        }

        if (empty($keys)) {
            return [];
        }

        return $this->_normalizeAssociations($keys);
    }