Retrieve the model for a bound value.

@param mixed $value

@return \Illuminate\Database\Eloquent\Model|null
180075
public function resolveRouteBinding($value)
    {
        return in_array(request()->route('accessarea'), config('cortex.foundation.obscure'))
            ? $this->where($this->getKeyName(), optional(Hashids::decode($value))[0])->first()
            : $this->where($this->getRouteKeyName(), $value)->first();
    }
454263
public function with($value)
    {
        $withs = explode(',', $value);
        $model = $this->builder->getModel();
        $withs = collect($withs)->filter(function ($with) use($model) {
            if (str_contains($with, '.')) return ($model->{explode('.', $with)[0]}() instanceof Relation);
            return ($model->{$with}() instanceof Relation);
        })->toArray();
        return $this->builder->when(count($withs), function (Builder $query) use($withs) {
            $query->with($withs);
        });
    }
911565
public function search( $value )
	{
		if( $value == $this->value )
			return $this;
		else if( $value < $this->value )
		{
			if( $this->left )
				return $this->left->search( $value );
		}
		else if( $value > $this->value )
		{
			if( $this->right )
				return $this->right->search( $value );
		}
		return NULL;
	}
1124744
public function resolve($value)
    {
        foreach ($this->transformers as $transformer) {
            if ($transformer->supports($value)) {
                return $transformer;
            }
        }

        return new NullTransformer();
    }
408957
public function getSaveValue($value)
    {
        $localeData = $this->getLocaleSaveData();

        /*
         * Set the translated values to the model
         */
        if ($this->model->methodExists('setAttributeTranslated')) {
            foreach ($localeData as $locale => $value) {
                $this->model->setAttributeTranslated('content', $value, $locale);

                $this->model->setAttributeTranslated(
                    'content_html',
                    Post::formatHtml($value),
                    $locale
                );
            }
        }

        return array_get($localeData, $this->defaultLocale->code, $value);
    }
893817
public function filterByValue($value)
    {
        $callback = function (BindingInterface $binding, $key) use ($value) {
            return $binding->getValue() == $value;
        };

        return $this->filter($callback);
    }
1016097
protected function buildValue($value): Model
    {
        if ($value instanceof Model || is_null($value)) {
            return $value;
        }

        $model = Attribute::getTypeModel($this->attribute->getAttribute('type'));
        $instance = new $model();

        $instance->setAttribute('entity_id', $this->entity->getKey());
        $instance->setAttribute('entity_type', $this->entity->getMorphClass());
        $instance->setAttribute($this->attribute->getForeignKey(), $this->attribute->getKey());
        $instance->setAttribute('content', $value);

        return $instance;
    }
282816
public function getKey($value) {
		foreach ($this->collection as $k => $v) {
			if ($v === $value) {
				return $k;
			}
		}
		
		return null;
	}
87414
public static function fromValue($value)
    {
        foreach (static::values() as $key => $enumInstance) {
            if ($enumInstance->getValue() === $value) {
                return $enumInstance;
            }
        }

        return null;
    }
1363813
public function value($value = null)
    {
        $element = clone $this;

        $element->value = $value;

        $element->applyValueToOptions();

        return $element;
    }
930575
public static function getTypeFromValue($value)
    {
        switch (gettype($value)) {
            case 'boolean':
                if ($value) {
                    return Type::getTrue();
                }

                return Type::getFalse();

            case 'integer':
                return Type::getInt(false, $value);

            case 'double':
                return Type::getFloat($value);

            case 'string':
                return Type::getString($value);

            case 'array':
                return Type::getArray();

            case 'NULL':
                return Type::getNull();

            default:
                return Type::getMixed();
        }
    }
165930
public function val($value = null)
    {
        if (!$this->isNull($value)) {
            $this->value = $value;

            return $this;
        }

        return $this->getDateObject()->format($this->format);
    }
603211
public function get($value) {

		return isset($this->items[$value]) ? $this->items[$value] : NULL;

	}
175032
public function get($key, $value = null)
    {
        return $this->postBag->key($key, $value, true);
    }
936571
protected function _query($value)
    {
        $select = $this->getSelect();
        /**
         * Run query
         */
        $result = $select->getAdapter()->fetchRow(
            $select,
            array('value' => $value), // this should work whether db supports positional or named params
            Zend_Db::FETCH_ASSOC
            );

        return $result;
    }
1373038
public function dbTypecastValue($value)
    {
        if ($value === null) {
            return null;
        }

        switch ($this->type) {
            case Schema::TYPE_BIT:
                return decbin($value);
            case Schema::TYPE_BINARY:
                return is_string($value) ? new PdoValue($value, \PDO::PARAM_LOB) : $value;
            case Schema::TYPE_TIMESTAMP:
            case Schema::TYPE_DATETIME:
                return \Yii::$app->formatter->asDatetime($value, 'yyyy-MM-dd HH:mm:ss');
            case Schema::TYPE_DATE:
                return \Yii::$app->formatter->asDate($value, 'yyyy-MM-dd');
            case Schema::TYPE_TIME:
                return \Yii::$app->formatter->asTime($value, 'HH:mm:ss');
            case Schema::TYPE_JSON:
                return new JsonExpression($value, $this->dbType);
            case Schema::TYPE_COMPOSITE:
                return new CompositeExpression($value, $this->dbType, $this);
        }

        return $this->typecast($value);
    }
1169413
private function sregValue($value = '')
    {
        $owner = $this->owner;
        $values = explode('|', $value);
        $count = count($values);
        foreach ($values as $key => $fieldPath) {
            if ($fieldPath == '' || $fieldPath == 'null') {
                return null;
            } elseif ($relValue = $this->sregTraverse($fieldPath)) {
                if (is_object($relValue) && method_exists($relValue, 'AbsoluteLink')) {
                    if ($link = $relValue->AbsoluteLink()) {
                        return $link;
                    } else {
                        continue;
                    }
                } else {
                    return $relValue;
                }
            } elseif ($key + 1 == $count && !$owner->hasMethod($fieldPath) ) {
                return $fieldPath;
            }
        }
    }