src/Charcoal/Admin/Property/AbstractSelectableInput.php
protected function parseChoiceVal($value)
    {
        if ($value instanceof ModelInterface) {
            $value = $value->id();
        }

        if ($value instanceof Closure) {
            $value = $value();
        }

        if ($value instanceof DateTimeInterface) {
            $value = $value->format('Y-m-d-H:i');
        }

        if (method_exists($value, '__toString')) {
            $value = strval($value);
        }

        return $value;
    }
protected function parseChoiceVal($value)
    {
        if ($value instanceof ModelInterface) {
            $value = $value->id();
        }

        if ($value instanceof Closure) {
            $value = $value();
        }

        if ($value instanceof DateTimeInterface) {
            $value = $value->format('Y-m-d-H:i');
        }

        if (method_exists($value, '__toString')) {
            $value = strval($value);
        }

        return $value;
    }
protected function parseChoiceVal ( $ value ) { if ( $ value instanceof ModelInterface ) { $ value = $ value -> id ( ) ; } if ( $ value instanceof Closure ) { $ value = $ value ( ) ; } if ( $ value instanceof DateTimeInterface ) { $ value = $ value -> format ( 'Y-m-d-H:i' ) ; } if ( method_exists ( $ value , '__toString' ) ) { $ value = strval ( $ value ) ; } return $ value ; }
Convert the value to a scalar.

@param  mixed $value A value to parse.
@return mixed
Convert the value to a scalar .