/** * Get collection item for key. * * @param string $key The data key * @param mixed $default The default value to return when key does not exists in the collection, default is null * @return mixed */ public function get($key, $default = null) { if ($this->has($key)) { $item = parent::get($this->normalizeKey($key), $default); return $item['value']; } return $default; }
/** * Get inputs of the route. * * @return Collection */ public function getInputs() { $inputs = $this->settings->get('inputs'); if (is_array($inputs) && count($inputs)) { return new Collection($inputs); } else { return new Collection(array()); } }
/** * Retrieve a single derived request attribute. * * Retrieves a single derived request attribute as described in * getAttributes(). If the attribute has not been previously set, returns * the default value as provided. * * This method obviates the need for a hasAttribute() method, as it allows * specifying a default value to return if the attribute is not found. * * @see getAttributes() * @param string $name The attribute name. * @param mixed $default Default value to return if the attribute does not exist. * @return mixed */ public function getAttribute($name, $default = null) { return $this->attributes->get($name, $default); }
/** * Get the output item by name. * * @param string $name The output item name * * @return mixed */ public function getOutput($name) { return $this->outputs->get($name); }