Skip to content

Instantly share code, notes, and snippets.

@stuarthannig
Created August 18, 2015 16:53
Show Gist options
  • Save stuarthannig/d56f4bddf0b4c641a94c to your computer and use it in GitHub Desktop.
Save stuarthannig/d56f4bddf0b4c641a94c to your computer and use it in GitHub Desktop.
Using Guzzle 6 in Laravel 5.1
<?php
# Install Guzzle by running `composer require guzzlehttp/guzzle`
Route::get('github/{username}', function ($username) {
$client = new GuzzleHttp\Client();
$request = $client->get("https://api.github.com/users/{$username}");
echo $request->getBody();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment