wantsJson()) { throw ValidationException::withMessages([ 'password' => [$message], ]); } return back()->withErrors(['password' => $message]); } }