You can use Guzzle :
Install it:
composer require guzzle/guzzle ~3.0
Create a base URL for the client:
$client = new \Guzzle\Service\Client('http://api.github.com/users/');
Get the answer:
$response = $client->get("users/$username")->send();
And display it:
dd($response);
But if you are trying to follow the MVC pattern, you should not do it directly in your controller, so create a class of service called from your controller or your repositories to do the job for you.
Antonio Carlos Ribeiro Mar 27 '14 at 17:55 2014-03-27 17:55
source share