src/Mappable.php
protected function getTarget($target, array $segments)
    {
        foreach ($segments as $segment) {
            if (!$target) {
                return;
            }

            $target = $target->{$segment};
        }

        return $target;
    }
protected function getTarget($target, array $segments)
    {
        foreach ($segments as $segment) {
            if (!$target) {
                return;
            }

            $target = $target->{$segment};
        }

        return $target;
    }
protected function getTarget ( $ target , array $ segments ) { foreach ( $ segments as $ segment ) { if ( ! $ target ) { return ; } $ target = $ target -> { $ segment } ; } return $ target ; }
Get mapped value.

@param  \Illuminate\Database\Eloquent\Model $target
@param  array  $segments
@return mixed
Get mapped value .