src/Concerns/SessionHelper.php
public function old(string $name)
    {
        if (! isset($this->session)) {
            return null;
        }

        $key     = $this->transformKey($name);
        $payload = $this->session->getOldInput($key);

        if (! \is_array($payload)) {
            return $payload;
        }

        if (! \in_array($this->type, ['select', 'checkbox'])) {
            if (! isset($this->payload[$key])) {
                $this->payload[$key] = Collection::make($payload);
            }

            if (! empty($this->payload[$key])) {
                $value = $this->payload[$key]->shift();

                return $value;
            }
        }

        return $payload;
    }
public function old(string $name)
    {
        if (! isset($this->session)) {
            return null;
        }

        $key     = $this->transformKey($name);
        $payload = $this->session->getOldInput($key);

        if (! \is_array($payload)) {
            return $payload;
        }

        if (! \in_array($this->type, ['select', 'checkbox'])) {
            if (! isset($this->payload[$key])) {
                $this->payload[$key] = Collection::make($payload);
            }

            if (! empty($this->payload[$key])) {
                $value = $this->payload[$key]->shift();

                return $value;
            }
        }

        return $payload;
    }
Get a value from the session's old input.

@param  string  $name

@return array|string|null