Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to autoload Guzzle in Laravel 4

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 269
    Comment on it

    It becomes easier with Guzzle, which is a PHP HTTP, to send HTTP requests. Moreover, one can easily perform the task of integrating with web services. Guzzle enables to send both synchronous and asynchronous requests.

    Guzzle using Laravel 4.x: You dont need to add Guzzle to your composer.json when using Laravel 4.x. The hassle is eliminated because of autoloading by it's own composer.json.

    Guzzle 4
    Requirment: PHP 5.4.x+ required

    Command:

    composer require "guzzlehttp/guzzle" "~4.0"
    

    Then we will create a command.

    $client = new \GuzzleHttp\Client();
    

    Get results:

    $response = $client->get('http://api.github.com/users/antonioribeiro');
    
    dd($response->getBody());
    

    By this way we will autoload Guzzle in Laravel 4.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: