File tree Expand file tree Collapse file tree 1 file changed +16
-21
lines changed Expand file tree Collapse file tree 1 file changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -24,27 +24,22 @@ function validateEmail(string $email)
2424 }
2525}
2626
27- if (! function_exists ('valid_email_rule ' )) {
28- function valid_email_rule ()
29- {
30- Validator::extend (
31- 'valid_email ' ,
32- /**
33- * @throws GuzzleException
34- */
35- function ($ attribute , $ value , $ parameters , $ validator ) {
36- try {
37- $ validation = validateEmail ($ value );
38-
39- return $ validation ->status === 'valid ' && $ validation ->disposable === false ;
40- } catch (Exception $ e ) {
41- if (class_exists ('Illuminate\Support\Facades\Log ' )) {
42- Log::error ($ e ->getMessage ());
43- }
27+ Validator::extend (
28+ 'valid_email ' ,
29+ /**
30+ * @throws GuzzleException
31+ */
32+ function ($ attribute , $ value , $ parameters , $ validator ) {
33+ try {
34+ $ validation = validateEmail ($ value );
4435
45- return false ;
46- }
36+ return $ validation ->status === 'valid ' ;
37+ } catch (Exception $ e ) {
38+ if (class_exists ('Illuminate\Support\Facades\Log ' )) {
39+ Log::error ($ e ->getMessage ());
4740 }
48- );
41+
42+ return false ;
43+ }
4944 }
50- }
45+ );
You can’t perform that action at this time.
0 commit comments