Laravel Radio button input confirmation

I have five radio buttons with values

value="1"
value="2"
value="3"
value="4"
value="5"

Obviously, I get only one value.

How can I use the Laravel validator

$this->validate($request, [

To make sure the input signal is 1,2,3,4 or 5?

+4
source share
1 answer

You can use a validation rule in:

$this->validate($request, [
    'field_name' => 'in:1,2,3,4,5'
]);

For more information, see the Laravel Validation Documentation .

+4
source

Source: https://habr.com/ru/post/1619525/


All Articles