J
J
Jedi2018-05-15 14:09:27
Laravel
Jedi, 2018-05-15 14:09:27

How to solve problem with unique validator when updating post?

A similar question has already been asked, but the answer did not please me, and I think that the solution is not entirely correct.
When updating a post, if the title has not changed, for example, then the validator will generate an error: "This is already in use."
How can this problem be solved ?
Thanks to!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pLavrenov, 2018-06-04
@PHPjedi

You can make custom wheels. In it, do a header check.
Documentation - https://laravel.ru/docs/v5/validation#own
Total in the controller code will be beautiful and possibly reusable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question