title: retrieve all rows in Google Spreadsheet via API using Laravel
body: <p>I'm trying to get the data from Google spread sheet by using this library: <a href="https://github.com/kawax/laravel-google-sheets/" rel="nofollow noreferrer">This tutorial</a>, and I follow this tutorial to configure the setup of API and no any error, but once I tried to implement any of the examples they provide in the above link, it show me some errors:</p>
  
  <p>Example 1 (on their link):</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use PulkitJalan\Google\Facades\Google;
  use Revolution\Google\Sheets\Sheets;
  
  class SpreadController extends Controller
  {
      function index()
      {
          $rows = Sheets::sheet('Sheet 1')-&gt;get();
  
          $header = $rows-&gt;pull(0);
          $values = Sheets::collection($header, $rows);
          dd($values);
      }
  
  }
  </code></pre>
  
  <p>The error is: </p>
  
  <blockquote>
    <p>Unresolvable dependency resolving [Parameter #0 [  array
    $config ]] in class PulkitJalan\Google\Client</p>
  </blockquote>
  
  <hr>
  
  <p>Example 2 (on their link):</p>
  
  <p>Code: </p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use PulkitJalan\Google\Facades\Google;
  use Revolution\Google\Sheets\Sheets;
  
  class SpreadController extends Controller
  {
      function index()
      {
          $user = $request-&gt;user();
  
          $token = [
              'access_token'  =&gt; $user-&gt;access_token,
              'refresh_token' =&gt; $user-&gt;refresh_token,
              'expires_in'    =&gt; $user-&gt;expires_in,
              'created'       =&gt; $user-&gt;updated_at-&gt;getTimestamp(),
          ];
  
  // all() returns array
          $values = Sheets::setAccessToken($token)-&gt;spreadsheet('1n0nyJX9wYp-_frg7TzoyMu3WyuSwtCo21g')-&gt;sheet('Sheet 1')-&gt;all();
  
      }
  
  }
  </code></pre>
  
  <p>The error is: </p>
  
  <blockquote>
    <p>Undefined variable: request</p>
    
    <hr>
  </blockquote>
  
  <p>This is the config file in the library directory ("vendor/pulkitjalan/google-apiclient/src/config/config.php"):</p>
  
  <pre><code>&lt;?php
  
  return [
      /*
      |----------------------------------------------------------------------------
      | Google application name
      |----------------------------------------------------------------------------
      */
      'application_name' =&gt; env('GOOGLE_APPLICATION_NAME', ''),
  
      /*
      |----------------------------------------------------------------------------
      | Google OAuth 2.0 access
      |----------------------------------------------------------------------------
      |
      | Keys for OAuth 2.0 access, see the API console at
      | https://developers.google.com/console
      |
      */
      'client_id'       =&gt; env('GOOGLE_CLIENT_ID', ''),
      'client_secret'   =&gt; env('GOOGLE_CLIENT_SECRET', ''),
      'redirect_uri'    =&gt; env('GOOGLE_REDIRECT', ''),
      'scopes'          =&gt; [],
      'access_type'     =&gt; 'online',
      'approval_prompt' =&gt; 'auto',
  
      /*
      |----------------------------------------------------------------------------
      | Google developer key
      |----------------------------------------------------------------------------
      |
      | Simple API access key, also from the API console. Ensure you get
      | a Server key, and not a Browser key.
      |
      */
      'developer_key' =&gt; env('GOOGLE_DEVELOPER_KEY', ''),
  
      /*
      |----------------------------------------------------------------------------
      | Google service account
      |----------------------------------------------------------------------------
      |
      | Set the credentials JSON's location to use assert credentials, otherwise
      | app engine or compute engine will be used.
      |
      */
      'service' =&gt; [
          /*
          | Enable service account auth or not.
          */
          'enable' =&gt; env('GOOGLE_SERVICE_ENABLED', false),
  
          /*
          | Path to service account json file
          */
          'file' =&gt; env('GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION', '')
      ],
  
      /*
      |----------------------------------------------------------------------------
      | Additional config for the Google Client
      |----------------------------------------------------------------------------
      |
      | Set any additional config variables supported by the Google Client
      | Details can be found here: 
      | https://github.com/google/google-api-php-client/blob/master/src/Google/Client.php
      | 
      | NOTE: If client id is specified here, it will get over written by the one above.
      |
      */
      'config' =&gt; [],
  ];
  </code></pre>
  
  <hr>
  
  <p>and .env file contains this assigned values for the config variables:</p>
  
  <pre><code> GOOGLE_APPLICATION_NAME= Append Data
   GOOGLE_CLIENT_ID= 995576272219-q9t67ufvehsqoctcq7g.apps.googleusercontent.com
   GOOGLE_CLIENT_SECRET= ow1kEPcuSEGmGIXZtl
   GOOGLE_REDIRECT=
   GOOGLE_DEVELOPER_KEY=
   GOOGLE_SERVICE_ENABLED=
   GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION=
  </code></pre>
  
  <p>Can anyone guide me through the solution how I can get the data from spreadsheet or solve the problem considered here.</p>