mardi 30 mai 2017

Laravel Class 'App\Http\Controllers\GuzzleHttp\Client' not found

I have a problem with using guzzle, I am getting:

FatalThrowable Error with class not being found.

First I did: composer require guzzlehttp/guzzle

and then in my controller I have added:

use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;

and at this moment controller loooks like this:

function guzzle()
{
    $client = new Client();
    $results = $client->get('http://ift.tt/2riWRk3');

    //$result->getBody();
    //return view('hello')->with('results', $results);
    //dd($result);

    $response = $results->send();

    dd($results->getBody());
    dd($response);

    return view('hello');
}

How can this issue be fixed



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire