src/FormBuilder.php
public function getValueAttribute(?string $name, $value = null)
    {
        if (\is_null($name)) {
            return $value;
        }

        if (! \is_null($old = $this->old($name)) && $name !== '_method') {
            return $old;
        }

        if (\class_exists(Kernel::class, false)) {
            $hasNullMiddleware = \app(Kernel::class)->hasMiddleware(ConvertEmptyStringsToNull::class);

            if ($hasNullMiddleware && \is_null($old) && \is_null($value)
                && ! \is_null($this->view->shared('errors'))
                && \count($this->view->shared('errors')) > 0
            ) {
                return null;
            }
        }

        if (! \is_null($request = $this->request($name)) && $name !== '_method') {
            return $request;
        }

        if (! \is_null($value)) {
            return $value;
        }

        if (isset($this->model)) {
            return $this->getModelValueAttribute($name);
        }
    }
public function getValueAttribute(?string $name, $value = null)
    {
        if (\is_null($name)) {
            return $value;
        }

        if (! \is_null($old = $this->old($name)) && $name !== '_method') {
            return $old;
        }

        if (\class_exists(Kernel::class, false)) {
            $hasNullMiddleware = \app(Kernel::class)->hasMiddleware(ConvertEmptyStringsToNull::class);

            if ($hasNullMiddleware && \is_null($old) && \is_null($value)
                && ! \is_null($this->view->shared('errors'))
                && \count($this->view->shared('errors')) > 0
            ) {
                return null;
            }
        }

        if (! \is_null($request = $this->request($name)) && $name !== '_method') {
            return $request;
        }

        if (! \is_null($value)) {
            return $value;
        }

        if (isset($this->model)) {
            return $this->getModelValueAttribute($name);
        }
    }
Get the value that should be assigned to the field.

@param  string|null  $name
@param  mixed  $value

@return mixed