Overtrue\LaravelShoppingCart\Item::__get PHP Method

__get() public method

Magic accessor.
public __get ( string $property ) : mixed
$property string Property name.
return mixed
    public function __get($property)
    {
        if ($this->has($property)) {
            return $this->get($property);
        }
        if (!$this->get('__model')) {
            return;
        }
        $model = $this->get('__model');
        $class = explode('\\', $model);
        if (strtolower(end($class)) === $property) {
            $model = new $model();
            return $model->find($this->id);
        }
        return;
    }