jeudi 3 mars 2022

Laravel - validate input to be in the interval [-1, 10] without 0. not_in not working properly?

As the title says, I'm having trouble validating an input field like I said in the title.

I tried it this way:

$request->validate([
            'nota' => 'min:-1|not_in:0|max:10',
        ]);

Basically, I want this "nota" field to have values in the interval [-1, 10] without 0.

But I can still enter 0.

Why doesn't it work and how can I fix it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire