jeudi 24 novembre 2016

Dependency not found in package

I am new to Laravel and I am trying to create a Scraper package to get some data from a website.

I created the package but I cannot access the GuzzleClient from the package.

The scraper class is very simple:

class Scraper {
    public function get() {
        $client = new \GuzzleHttp\Client();

    }

}

The Provider:

 public function register()
    {

        App::bind('scraper', function()
        {
            return new Scraper;
        });
    }

The GuzzleClient is declared in composer.json and installed successfully. I am calling the scrapper method in a controller.

I tried the command composer dump-autoload on project root and package root but it didnt work.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire