protected function getDefaultValueAccessor($modelVariable, $property, $value)
    {
        if (Helpers::isNewerThanOrEqualTo('5.5')) {
            $template = sprintf('optional($%s)->%s', $modelVariable, $property);

            if (is_null($value) || in_array($value, ['null', '[]'])) {
                return $template;
            }

            return $template . ' ?: ' . $value;
        }

        return sprintf("isset(\$%s->%s) ? \$%s->%s : %s", $modelVariable, $property, $modelVariable, $property, $value);
    }
protected function getDefaultValueAccessor($modelVariable, $property, $value)
    {
        if (Helpers::isNewerThanOrEqualTo('5.5')) {
            $template = sprintf('optional($%s)->%s', $modelVariable, $property);

            if (is_null($value) || in_array($value, ['null', '[]'])) {
                return $template;
            }

            return $template . ' ?: ' . $value;
        }

        return sprintf("isset(\$%s->%s) ? \$%s->%s : %s", $modelVariable, $property, $modelVariable, $property, $value);
    }
protected function getDefaultValueAccessor ( $ modelVariable , $ property , $ value ) { if ( Helpers :: isNewerThanOrEqualTo ( '5.5' ) ) { $ template = sprintf ( 'optional($%s)->%s' , $ modelVariable , $ property ) ; if ( is_null ( $ value ) || in_array ( $ value , [ 'null' , '[]' ] ) ) { return $ template ; } return $ template . ' ?: ' . $ value ; } return sprintf ( "isset(\$%s->%s) ? \$%s->%s : %s" , $ modelVariable , $ property , $ modelVariable , $ property , $ value ) ; }
Gets the best value accessor for the view

@param string $modelVariable
@param string $property
@param string $value

@return string
Gets the best value accessor for the view