Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator not found in User::updateEmail #79

Closed
tjarrett opened this issue Jan 26, 2021 · 3 comments
Closed

Validator not found in User::updateEmail #79

tjarrett opened this issue Jan 26, 2021 · 3 comments

Comments

@tjarrett
Copy link

When trying to change a user's email using code that looks like this:

$user = Zoom::user()->find('dummy-email@gmail.com');
$result = $user->updateEmail('inst-id@inst.edu');

I get the following Exception:

[vagrant@wse zoomadmin]$ ./artisan zoom

   Error 

  Class 'MacsiDigital\Zoom\Validator' not found

  at vendor/macsidigital/laravel-zoom/src/User.php:133
    129▕     }
    130▕ 
    131▕     public function updateEmail($email)
    132▕     {
  ➜ 133▕         $validator = Validator::make(['email' => $email], [ 'email' => 'required|email|max:128' ]);
    134▕         if ($validator->fails()) {
    135▕             throw new ValidationException('Email must be a valid email address less than 128 characters');
    136▕         } else {
    137▕             return $this->newQuery()->sendRequest('put', ['users/'.$this->id.'/email', ['email' => $email]])->successful();

  1   app/Console/Commands/ZoomCommand.php:51
      MacsiDigital\Zoom\User::updateEmail("inst-id@inst.edu")

      +13 vendor frames 
  15  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

I think we just need to add this line, which I'll submit a pull request for:

use Illuminate\Support\Facades\Validator;
@colinhall17
Copy link
Member

Hi @tjarrett

Thanks for finding the bug. Was there an issue with your pull request as I noticed it is now closed?

@tjarrett
Copy link
Author

tjarrett commented Feb 1, 2021

Hey @colinhall17,

Thanks for getting back to me.

Actually we can bring that pull request back to life if you like. I pulled it because my team and I ended up making other changes to that file that I was considering submitting to you but it was on a different repo and I didn't want to cause you any problems with pull requests that make the same change but have different commits.

The other changes have to do with #81. I'll post there about those.

Should I bring the pull request back?

@colinhall17
Copy link
Member

Hi @tjarrett

It's OK I had added it corrected in my local dev environment so I have just uploaded the bug fix and created a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants