PHPStorm Laravel Not Finding Alias Class for Laravel Goutte

I installed this package https://github.com/dweidner/laravel-goutte and followed the readme instructions. However, when I put this in my HomeController:

$crawler = Goutte::request('GET', 'https://duckduckgo.com/html/?q=Laravel');
$crawler->filter('.result__title .result__a')->each(function ($node) {
    dump($node->text());
});
return view('welcome');

I got an error “Undefined class Goutte”. When I mouseover Goutte in phpstorm, it only gives me the option to create a new class, not import a facade.

I re-ran composer dump-autoload and that cleared it. Also php artisan ide-helper:generate.

 

Published by

Joel Gross

Joel Gross is the CEO of Coalition Technologies.

Leave a Reply

Your email address will not be published. Required fields are marked *