S
S
Sergey2018-10-29 07:25:41
Laravel
Sergey, 2018-10-29 07:25:41

Own field validation, how?

There are fields that you need to quickly check, for the most part they are unique, and that's all for one action. How can I do this quickly in laravel? Only validator extensions via service provider? No other way? Directly in an action for example?
Version 5.1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2018-10-29
@Gadz

If you only need the functionality of a custom rule once throughout your application, you may use a Closure instead of a rule object.

https://laravel.com/docs/5.7/validation#using-closures

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question