public function get(string $key = null, $default = null)
    {
        $key = \str_replace('.', '/user-', $key);
        $value = Arr::get($this->items, $key);

        // We need to consider if the value pending to be deleted,
        // in this case return the default.
        if ($value === ':to-be-deleted:') {
            return \value($default);
        }

        // If the result is available from data, simply return it so we
        // don't have to fetch the same result again from the database.
        if (! \is_null($value)) {
            return $value;
        }

        if (\is_null($value = $this->handler->retrieve($key))) {
            return \value($default);
        }

        $this->put($key, $value);

        return $value;
    }
public function get(string $key = null, $default = null)
    {
        $key = \str_replace('.', '/user-', $key);
        $value = Arr::get($this->items, $key);

        // We need to consider if the value pending to be deleted,
        // in this case return the default.
        if ($value === ':to-be-deleted:') {
            return \value($default);
        }

        // If the result is available from data, simply return it so we
        // don't have to fetch the same result again from the database.
        if (! \is_null($value)) {
            return $value;
        }

        if (\is_null($value = $this->handler->retrieve($key))) {
            return \value($default);
        }

        $this->put($key, $value);

        return $value;
    }
public function get ( string $ key = null , $ default = null ) { $ key = \ str_replace ( '.' , '/user-' , $ key ) ; $ value = Arr :: get ( $ this -> items , $ key ) ; // We need to consider if the value pending to be deleted, // in this case return the default. if ( $ value === ':to-be-deleted:' ) { return \ value ( $ default ) ; } // If the result is available from data, simply return it so we // don't have to fetch the same result again from the database. if ( ! \ is_null ( $ value ) ) { return $ value ; } if ( \ is_null ( $ value = $ this -> handler -> retrieve ( $ key ) ) ) { return \ value ( $ default ) ; } $ this -> put ( $ key , $ value ) ; return $ value ; }
Get value of a key.

@param  string  $key
@param  mixed   $default

@return mixed
Get value of a key .