File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 99class PasswordExposed implements Rule
1010{
1111 private $ passwordExposedChecker ;
12+ private $ message = 'The :attribute has been exposed in a data breach. ' ;
1213
1314 public function __construct (PasswordExposedChecker $ passwordExposedChecker = null )
1415 {
@@ -41,6 +42,19 @@ public function passes($attribute, $value)
4142 */
4243 public function message ()
4344 {
44- return 'The :attribute has been exposed in a data breach. ' ;
45+ return $ this ->message ;
46+ }
47+
48+ /**
49+ * Set a custom validation error message.
50+ *
51+ * @param string $customMessage
52+ *
53+ * @return \DivineOmega\LaravelPasswordExposedValidationRule\PasswordExposed
54+ */
55+ public function setMessage ($ message )
56+ {
57+ $ this ->message = $ message ;
58+ return $ this ;
4559 }
4660}
You can’t perform that action at this time.
0 commit comments