App\Services\Html\FormBuilder::useInitialValue PHP Method

useInitialValue() public method

public useInitialValue ( $subject, string $propertyName, string $locale = '' ) : string
$propertyName string
$locale string
return string
    public function useInitialValue($subject, string $propertyName, string $locale = '') : string
    {
        $fieldName = $locale ? translate_field_name($propertyName, $locale) : $propertyName;
        $value = $locale ? $subject->translate($propertyName, $locale) : $subject->{$propertyName};
        if ($value instanceof Carbon) {
            $value = $value->format('d/m/Y');
        }
        return $this->getValueAttribute($fieldName, $value) ?? '';
    }