@szymon_zak if you use the $table->string('login')->unique(); This error at the database level. The database itself does not allow you to create the same records
That's because two users simultaneously being saved will likely both flow through the validator before any data is written to the database. This shouldn't be a common occurrence in your example, so the database unique constraint should be sufficient.
Is there a reason why this is critical in your use case? There could be a better solution but knowing why two users would be likely to set their email to the same thing at the same second could help point to how to deal with the issue.
@sutherland Login is just an example because I can't share production application code due to legal issues.
It has an API available which is used by 3rd party clients and I cannot use database unique constraint in my case thanks to API versioning.
My main problem is that validation bypass happened multiple times because currently clients generate huge amount of requests.
I've managed to solve problem by not using Laravel's unique and acquiring row access database lock manually so I can be sure that validation will not pass before data is written to it.
However I'm not happy how unique works, I shouldn't be forced to workround it.