title: Laravel Socialite Google login only with one domain
body: <p>I have a Google+ login on my app with Laravel Socialite. When the login is done I have a callback to connect the user (I create her in database if necessary).</p>
  
  <p>But I want to restrain the connection to only the company (email like "example@company.com", so only the email with "company.com").</p>
  
  <p>Can I do it with Laravel Socialite ? I can make the verification manually in my callback but if Socialite can do it, it's better.</p>
  
  <p>Thank you</p>
  
  <p>My callback :</p>
  
  <pre><code>public function handleProviderCallback($provider){
    $user = Socialite::driver($provider)-&gt;user();
  
    if ($user) {
      $local_user = User::whereEmail($user-&gt;getEmail())-&gt;first();
      // If we don't have a user create a new user
      if (!$local_user) {
        $fragment = explode(' ', $user-&gt;getName());
        $local_user = User::create([
          'first_name' =&gt; isset($fragment[0]) ? $fragment[0] : '',
          'last_name' =&gt; isset($fragment[1]) ? $fragment[1] : '',
          'email' =&gt; $user-&gt;getEmail(),
          'last_seen' =&gt; Carbon::now(),
          'password' =&gt; ''
        ]);
        $local_user-&gt;roles()-&gt;attach(Role::whereName('User')-&gt;first());
      }
      auth()-&gt;login($local_user);
    }
    return redirect($this-&gt;redirectTo);
  }
  </code></pre>