Use as like below in your UserController validate .
'email' => 'sometimes|required|email|unique:users,email,'.request()->user->id,
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am using forge, hosted on Digital Ocean.x
Every few days I get this error when trying to login or view any login side pages:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `users` where `email` = [email protected] limit 1)
Pages that do not require auth or database queries are unaffected and the issue can be fixed by restarting SQL.
However, this happens every few days and I am lost where to start debugging. No other errors are logged in Sentry and there are very few database queries happening. Last time this happened it was over the weekend when there would have been no queries happening at all. I wondered it it could be timing out due to inactivity but obviously this should not be happening.
I have a few light crons running all of the time, but they do not hit the DB at any point.
Please or to participate in this conversation.