File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,23 @@ function GetValidateDisposable($email,$api_key) {
2828 }
2929
3030
31- function ValidateDisposable ($ email ) {
31+ // $value holds the email address from the form.
32+ function ValidateDisposable ($ attribute , $ value , $ parameters , $ validator ) {
3233 if (!isset ($ api_key )) {
3334 $ api_key = env ('MBV_API_KEY ' );
3435 }
3536 $ source = 'laravel ' ;
3637 try {
3738 // Now we need to send the data to MBV API Key and return back the result.
38- $ results = file_get_contents ('https://api.mailboxvalidator.com/v1/email/disposable?key= ' . $ api_key . '&email= ' .$ email . '&source= ' .$ source );
39+ $ results = file_get_contents ('https://api.mailboxvalidator.com/v1/email/disposable?key= ' . $ api_key . '&email= ' .$ value . '&source= ' .$ source );
3940
4041 // Decode the return json results and return the data as an array.
4142 $ data = json_decode ($ results ,true );
4243
4344 // Called a function to return message for form validation
4445 if (trim ($ data ['error_code ' ]) == '' ) {
4546 if ( $ data ['is_disposable ' ] == true ) {
46- $ errorMessage = 'The email ' .$ email .' is disposable email and should not been used to register. ' ;
47+ $ errorMessage = 'The email ' .$ value .' is disposable email and should not been used to register. ' ;
4748 return false ;
4849 } else {
4950 return true ;
You can’t perform that action at this time.
0 commit comments