Get model by key
@param $key
@return mixed
516142
public static function find($key)
    {
        $instance = new static;

        $model = $instance->newQuery()->id($key)->take(1)->first();

        if ($model) {
            $model->exists = true;
        }

        return $model;
    }
458821
public static function get($key)
    {
        if (!self::$instance) return null;

        return self::$instance->cache->get($key);
    }
788688
public function find($key, $default = null)
    {
        if ($key instanceof Model) {
            $key = $key->getKey();
        }

        return array_first($this->items, function($itemKey, $model) use ($key)
        {
            return $model->getKey() == $key;

        }, $default);
    }
1270484
protected function getModelByKey(Model $model, $key)
    {
        return $model::withoutGlobalScopes()
            ->where($model->getKeyName(), $key)
            ->first();
    }
1264079
protected function objectForKey($key)
    {
        return DataObject::get($this->getSourceObject())
            ->filter($this->getKeyField(), $key)
            ->first();
    }
139158
protected function get($key)
    {
        return isset($this->errors[$key]) ? $this->errors[$key] : null;
    }
142145
public function get($key) {
		// If the key is in factories the return new instance of class
		if (isset($this->factories[$key])) {
			return $this->factories[$key]();
		}

		// If the key is not in instances
		if (!isset($this->instances[$key])) {
			// If the key is in registry, instanciate the corresponding class and add it in instances
			if (isset($this->registry[$key])) {
				$this->instances[$key] = $this->registry[$key]();
			} else {
				// If the key is not in registry, instanciate the corresponding class and add it in instances
				$this->instances[$key] = self::newInstance($key);
			}
		}

		return $this->instances[$key];
	}
1242790
public function getAttribute($key)
	{
		$inAttributes = array_key_exists($key, $this->attributes);

		// If the key references an attribute, we can just go ahead and return the
		// plain attribute value from the model. This allows every attribute to
		// be dynamically accessed through the _get method without accessors.
		if ($inAttributes || $this->hasGetMutator($key))
		{
			return $this->getAttributeValue($key);
		}

		// If the key already exists in the relationships array, it just means the
		// relationship has already been loaded, so we'll just return it out of
		// here because there is no need to query within the relations twice.
		if (array_key_exists($key, $this->relations))
		{
			return $this->relations[$key];
		}

		// If the "attribute" exists as a method on the model, we will just assume
		// it is a relationship and will load and return results from the query
		// and hydrate the relationship's value on the "relationships" array.
		if (method_exists($this, $key))
		{
			return $this->getRelationshipFromMethod($key);
		}
	}
307495
public function get($key)
    {
        $this->checkForKey($key);

        return $this->cache->get($this->path.$key);
    }
1039255
protected function getData($key)
    {
        $cacheKey = $this->key($key);
        return array_key_exists($cacheKey, $this->cache)?$this->cache[$this->key($key)]:false;
    }
1367497
protected function getByKey($key)
    {
        return $this->propertyBag()
            ->where('resource_id', $this->resource->getKey())
            ->where('key', $key)
            ->first();
    }
268575
public function find($key, $default = null)
    {
        if ($key instanceof Model) {
            $key = $key->getKey();
        }

        if (is_array($key)) {
            if ($this->isEmpty()) {
                return new static;
            }

            return $this->whereIn($this->first()->getKeyName(), $key);
        }

        return Arr::first($this->items, function ($model) use ($key) {
            return $model->getKey() === $key;
        }, $default);
    }
1028785
public function retrieve($key)
    {
        if (strpos($key, '.') !== FALSE) {
            list($name, $value) = explode('.', $key);

            if (empty($this->forms)) {
                $data        = $this->getModel()->where('name', '=', $name)->get();
                $this->forms = $this->processRetrievedData($data);
            }

            return Arr::get($this->forms, "{$name}.{$value}");
        }
    }
646730
public function getValueByKey($key)
    {
        $model = Configuration::whereConfigurationKey($key)->first();

        if (null === $model) {
            return null;
        }

        return $model->configuration_value;
    }
1006253
public function get($key)
    {
        $key = is_array($key) ? $key : [$key];
        $config = $this->data;
        while ($key) {
            $k = array_shift($key);
            $config = isset($config[$k]) ? $config[$k] : [];
        }
        return $config;
    }
256903
public function getAttribute($key, $model = false)
    {
        if (!$key) {
            return;
        }

        if (!$model) {
            $model = $this->model;
        }

        $formattedKey = str_replace('.', '_', $key);

        if ($this->hasGetAccessor($formattedKey)) {
            $method = 'get'.Str::studly($formattedKey).'Attribute';

            return $this->{$method}($model);
        }

        if ($this->hasGetAccessor($key)) {
            $method = 'get'.Str::studly($key).'Attribute';

            return $this->{$method}($model);
        }

        if ($this->hasRelatedKey($key, $model)) {
            return $this->relatedKey($key, $model);
        }

        return $model->getAttribute($key);
    }
1218576
public function get($key)
    {
        $res = $this->_errors[$key];
        if (!is_array($res)) {
            return [$res];
        }

        return $res;
    }