/** * Set a given configuration value. * * @param array|string $key * @param mixed $value */ public function set($key, $value = null) { if (is_array($key)) { foreach ($key as $innerKey => $innerValue) { Arr::set($this->items, $innerKey, $innerValue); } } else { Arr::set($this->items, $key, $value); } }
/** * Get a subset containing the provided keys with values from the input data. * * @param array|mixed $keys * * @return array */ public function only($keys) { $keys = is_array($keys) ? $keys : func_get_args(); $results = []; $input = $this->all(); foreach ($keys as $key) { Arr::set($results, $key, data_get($input, $key)); } return $results; }