Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Van4kk's avatar

Form request validation rule based on static values

Is there in Laravel a form request validation rule, that input value has to be only specific string or number

Basically:

public function rules()
    {
        return [
            'field' => 'required|string|A or B',
        ];
    }
0 likes
2 replies

Please or to participate in this conversation.