user image

Joseph Morgan
Published in : 2022-02-09

[solved] Class "App\Exceptions\Client" not found


Hello everyone I am facing issues in Laravel while I am using Twillo to send messages I am following this article // to create the SMS but when I start using this code 
Class "App\Exceptions\Client" not found

<?php/** * Sends sms to user using Twilio's programmable sms client * @param String $message Body of sms * @param Number $recipients string or array of phone number of recepient */private function sendMessage($message, $recipients) { $account_sid = getenv("TWILIO_SID"); $auth_token = getenv("TWILIO_AUTH_TOKEN"); $twilio_number = getenv("TWILIO_NUMBER"); $client = new Client($account_sid, $auth_token); $client->messages->create($recipients, ['from' => $twilio_number, 'body' => $message] );}

an error came to my face says that Client class was not found,
However in the article of clarification there is no class imported & I cannot find it 
Anyone can help!


Mohamed Atef Date : 2022-02-09

Best answers


Best answers


Client class should come from the Twillo SDK package you can use install it using the command below 

composer require twilio/sdk

then you can import it into your controller using 

use Twilio\Rest\Client;

You can follow the documentation on the package from here 

Joseph Morgan Date : 2022-02-09

Thanks it's very helpful, Everything is clear here on //

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

Undefined Variable problem on Laravel 9.x
Publish date: 2022-03-06 | Comments: 3
How to pass valiables to 404 error page in laravel?
Publish date: 2022-02-21 | Comments: 2
How can i pass data from blade template to vue component?
Publish date: 2022-02-11 | Comments: 1
How to check Laravel version?
Publish date: 2022-04-07 | Comments: 2
Increase Sanctum token length in Laravel x9
Publish date: 2022-07-16 | Comments: 2
Laravel error 419 page expired
Publish date: 2021-04-10 | Comments: 2