src/Services/InputMaker.php
public function getObjectValue($object, $name)
    {
        if (is_object($object) && isset($object->$name) && !method_exists($object, $name)) {
            return $object->$name;
        }

        // If its a nested value like meta[user[phone]]
        if (strpos($name, '[') > 0) {
            $nested = explode('[', str_replace(']', '', $name));
            $final = $object;
            foreach ($nested as $property) {
                if (!empty($property) && isset($final->{$property})) {
                    $final = $final->{$property};
                } elseif (is_object($final) && is_null($final->{$property})) {
                    $final = '';
                }
            }

            return $final;
        }

        return '';
    }
public function getObjectValue($object, $name)
    {
        if (is_object($object) && isset($object->$name) && !method_exists($object, $name)) {
            return $object->$name;
        }

        // If its a nested value like meta[user[phone]]
        if (strpos($name, '[') > 0) {
            $nested = explode('[', str_replace(']', '', $name));
            $final = $object;
            foreach ($nested as $property) {
                if (!empty($property) && isset($final->{$property})) {
                    $final = $final->{$property};
                } elseif (is_object($final) && is_null($final->{$property})) {
                    $final = '';
                }
            }

            return $final;
        }

        return '';
    }
public function getObjectValue ( $ object , $ name ) { if ( is_object ( $ object ) && isset ( $ object -> $ name ) && ! method_exists ( $ object , $ name ) ) { return $ object -> $ name ; } // If its a nested value like meta[user[phone]] if ( strpos ( $ name , '[' ) > 0 ) { $ nested = explode ( '[' , str_replace ( ']' , '' , $ name ) ) ; $ final = $ object ; foreach ( $ nested as $ property ) { if ( ! empty ( $ property ) && isset ( $ final -> { $ property } ) ) { $ final = $ final -> { $ property } ; } elseif ( is_object ( $ final ) && is_null ( $ final -> { $ property } ) ) { $ final = '' ; } } return $ final ; } return '' ; }
Get the object value from the object with the name.

@param mixed  $object
@param string $name

@return mixed
Get the object value from the object with the name .