title: Retrieving facebook user access token with socialite on laravel 5.4
body: <p>I am trying to get user access token so I can send CURL request through Guzzle to Facebook's Graph API to get user's friends that are using the app. But I can't seem to be able to obtain it.
  Here's my controller:</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use GuzzleHttp\Exception\GuzzleException;
  use GuzzleHttp\Client;
  use Socialite;
  
  class SocialFriendsController extends Controller
  {
  
      public function getFacebookFriends()
      {
  
      $user = Socialite::driver('facebook')-&gt;user();
      $access_token = $user-&gt;token;
  
      $client = new Client();
      $body = $client-&gt;get('https://graph.facebook.com/v2.11/me/friends', [
          'query' =&gt; [
              'access_token' =&gt; '$access_token',
          ]
      ])-&gt;getBody();
  
          $result = \GuzzleHttp\json_decode($body, 1);
      return view('pages.admin.posts.create', ['result' =&gt; $result]);
     }
  
  }
  </code></pre>