Joseph Morgan

9 Feb 2022

[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


 * 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);
 ['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

9 Feb 2022

Best Answer

best answer

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

9 Feb 2022

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

© 2024 Copyrights reserved for