title: Laravel RateLimiter
body: <p>I'm fairly new to Laravel and am currently using an API that has a limit of 25 requests per minute.
  I have a controller method <code>sendRequest()</code> which is used by all methods to send requests to the API so I was thinking this is the place to put a rate limiter that checks if the current request can be added to the queue if the limit is not yet reached.</p>
  <p>I was thinking something like this:</p>
  <pre><code>protected function sendRequest(){
      if ($this-&gt;allowRequest()) {
          //proceed to api call
      }
  }
  
  protected function allowRequest() {
      $allow = false;
      //probably a do-while loop to check if the limit has been reached within the timeframe?
  }
  </code></pre>
  <p>I've found this class <code>Illuminate\Cache\RateLimiter</code> that I think could be useful but have no idea how to use it yet. Can anyone point me to the right direct with this? So basically the request should &quot;wait&quot; and execute only if the 25 requests/minute limit hasn't been reached.</p>
  <p>Thanks!</p>