title: How to get user data from google using socialite google driver
body: <p>
  I m trying to work with laravel google socialite driver where i need to get user data from google using access token that i am getting from my api call.
  But when i thought i have done everything correctly it's giving an error 
  saying <code>Call to protected method Laravel\\Socialite\\Two\\GoogleProvider::getUserByToken()</code></p>
  
  <p>I understand that its saying  i can't access that method because its protect.
  So how to get around this problem.</p>
  
  <p><strong>My objective</strong></p>
  
  <p>My objective is to validate the social access (basically google) token that i am getting from my mobile app and store that user's data for that particulate user into my database that i am receiving from socialite
  
  My Route in <code>api.php</code></p>
  
  <pre><code>Route::post('login','api\unAuthApiCall@index');
  </code></pre>
  
  <p>My controller</p>
  
  <pre><code>namespace App\Http\Controllers\api;
  use App\Http\Controllers\Controller;
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Input;
  use Laravel\Socialite\Facades\Socialite;
  
  
  class unAuthApiCall extends Controller
  {
      //Get the authentication token
      public function index(Request $request){
  
          //get the auth token
          $authToken= Input::get('auth_token');
  
          //Validate authtoken with google and get user's data
          $driver = Socialite::driver('google');
  
          $socialUserObject= $driver-&gt;getUserByToken($authToken);
  
          return json_encode($socialUserObject);
      }
  }
  </code></pre>
  
  
  
  <p>Response i am getting</p>
  
  <pre><code>{
      "message": "Call to protected method Laravel\\Socialite\\Two\\GoogleProvider::getUserByToken() from context 'App\\Http\\Controllers\\api\\unAuthApiCall'",
      "exception": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
      "file": "C:\\Users\\CODED\\Documents\\laravelSocilte\\app\\Http\\Controllers\\api\\unAuthApiCall.php",
      "line": 28,
      "trace": [
          {
              "function": "index",
              "class": "App\\Http\\Controllers\\api\\unAuthApiCall",
              "type": "-&gt;"
          }
  </code></pre>