Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'Illuminate\Support\Facades\Http' not found in Laravel 7.x #33270

Closed
cupcodei opened this issue Jun 18, 2020 · 2 comments
Closed

Class 'Illuminate\Support\Facades\Http' not found in Laravel 7.x #33270

cupcodei opened this issue Jun 18, 2020 · 2 comments

Comments

@cupcodei
Copy link

cupcodei commented Jun 18, 2020

Hello.
I wanted to use GuzzleHttp in my project in my custom class but after installing it using
composer require guzzlehttp/guzzle I get
Class 'Illuminate\Support\Facades\Http' not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'Illuminate\\Support\\Facades\\Http' not found in laravel.log

here is my custom class

`namespace App\MyModels\GetData;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;

class Test
{
public function __invoke()
{
Log::info("Cron executed : " );
$response = Http::get("https://google.com");
Log::info(print_r($response,true) );
}

}`

from stackoverflow I found although a guzzlehttp folder exists in vendor but there is no http.php file in \vendor\laravel\framework\src\Illuminate\Support\Facades

@GrahamCampbell
Copy link
Member

from stackoverflow I found although a guzzlehttp folder exists in vendor but there is no http.php file in \vendor\laravel\framework\src\Illuminate\Support\Facades

This happens if you are using an old version of Laravel.

@GrahamCampbell
Copy link
Member

Please make sure you are using Laravel 7. You can get composer to list the installed laravel version with:

composer show | grep laravel/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants