Laravel twillio sms send issue

  Sat 25 / 03 / 2023

  Posted by: Usama Akhtar

Category : Laravel

Tags : laravel , php , backend

Post Thumbnail
Description

Exception : Twilio\Rest\Api\V2010\Account\MessageList::create(): Argument #1 ($to) must be of type string, null given,


View Code
                        $contractorNmr = User::where('id', $contractor->contractor_id)->first();

                                    $message = $AuthUser . ' ' . 'has created new work order';
 $client = new Client($account_sid, $auth_token);

                                        $client->messages->create($contractorNmr->mpnumber, [

                                            'from' => $twilio_number,

                                            'body' => $message

                                        ]);
                
  Answered by CDL

In the create method you are passing some null values, so make sure your value is there and try again. If still it doesn't work, reach out again in the comment.

  Comment   Share
0 Likes   1 Comment


comment-author
Hadayat Niazi Super Admin

If your issue was resolved, please mark this as solved.



Reply


commented 1 year ago