local.ERROR: Class “Client” not found

Posted by

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Error:- local.ERROR: Class “Client” not found

local.ERROR: Class "Client" not found (View: /opt/lampp/htdocs/devopsschool/ds-slides-ms/resources/views/userview/slide.blade.php) {"exception":"[object] (Illuminate\\View\\ViewException(code: 0): Class \"Client\" not found (View: /opt/lampp/htdocs/devopsschool/ds-slides-ms/resources/views/userview/slide.blade.php) at /opt/lampp/htdocs/devopsschool/ds-slides-ms/app/Http/Controllers/UserViewController.php:100)
[stacktrace]
#0 /opt/lampp/htdocs/devopsschool/ds-slides-ms/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(60): Illuminate\\View\\Engines\\CompilerEngine->handleViewException(Object(Error), 1)
#1 /opt/lampp/htdocs/devopsschool/ds-slides-ms/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(72): Illuminate\\View\\Engines\\PhpEngine->evaluatePath('/opt/lampp/htdo...', Array)
#2 /opt/lampp/htdocs/devopsschool/ds-slides-ms/vendor/laravel/framework/src/Illuminate/View/View.php(207): Illuminate\\View\\Engines\\CompilerEngine->get('/opt/lampp/htdo...', Array)
#3 /opt/lampp/htdocs/devopsschool/ds-slides-ms/vendor/laravel/framework/src/Illuminate/View/View.php(190): Illuminate\\View\\View->getContents()
#4 /opt/lampp/htdocs/devopsschool/ds-slides-ms/vendor/laravel/framework/src/Illuminate/View/View.php(159): Illuminate\\View\\View->renderContents()
#5 /opt/lampp/htdocs/devopsschool/ds-slides-ms/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\\View\\View->render()
#6 /opt/lampp/htdocs/devopsschool/ds-slides-ms/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\\Http\\Response->setContent(Object(Illuminate\\View\\View))

Solution:-

Step 1:- Go to you project. and find if the same error which i have shared then follow my steps otherwise don’t follow this.

Step 2:- find the controller in which you are facing this issue.

Step 3:- If your code looks like this then, change the code which i have done.

Step 4:- Change the following code from :

use Client as Client;

To This:-

use GuzzleHttp\Client as Client;

Step 5:- Now run the command which i have given below:\

php artisan optimize

Step 6:- Now refresh your page and your issue will resolved.

Issue Resolved.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x