Skip to content

Conversation

@Bloemendaal
Copy link

@Bloemendaal Bloemendaal commented Nov 15, 2025

The Laravel In validation accepts Enums. However, the type of this method blocks me from using this. Also the method that is being called expects mixed :)

Laravels implementation:

    public function __toString()
    {
        $values = array_map(function ($value) {
            $value = enum_value($value);

            return '"'.str_replace('"', '""', $value).'"';
        }, $this->values);

        return $this->rule.':'.implode(',', $values);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant