TheoKouzelis / laravel-mailgun-email-validation

Laravel email validation that uses the Mailgun API for a three-step validation check
https://documentation.mailgun.com/en/latest/api-email-validation.html#email-validation
MIT License
11 stars 10 forks source link

(Laravel 8) After following installation instructions, I get "Method Illuminate\Validation\Validator::validateMailgun does not exist." #12

Open titizali opened 3 years ago

titizali commented 3 years ago

Hi! Thanks for making this package available for everyone! I am so psyched to use it in production!

I am having some trouble getting it going, though :( I tried clearing all cache with no luck so far :/ Also added the service provider manually to config/app.php just in case. Any idea what's going on? Am I supposed to include something on my RegisterController? Here is the relevant code from RegisterController--I'm not using form requests. Thank you so much!

  $validator = Validator::make($request->all(), [
                'name' => 'required|string|max:255',
                'email' => 'required|string|email|max:255|unique:users|mailgun',
                'password' => 'required|string|min:8|confirmed',
                'terms'=>'accepted',
            ], $messages);
        if ($validator->fails()) {
            if ($validator->errors()->first('email') == $uniqueMsg) {
                return redirect()->to('/login')
                    ->withErrors($validator)
                    ->withInput();
            } else {
                return redirect()->to('/register')
                    ->withErrors($validator)
                    ->withInput();
            }
        }