

You should generate a phone number for your application in the Nexmo control panel.Īdd your nexmo api key and nexmo secret to your.

The sms_from option is the phone number that your SMS messages will be sent from. env and the value passed to the env() helper function will need to match the key in the. Do not replace NEXMO_KEY and NEXMO_SECRET in the above with your actual key and secret as they are going to be stored in the.
#NEXMO BULK SMS SENDER CODE#
NB Please only change the "your-nexmo-phone-number" part in the code above. To send a custom sms notification to all of your users, you could use Laravel's built-in notification system.Īll of the information you will need to get started is in the Documentation on Laravel's website.ĭownload the nexmo composer package: composer require nexmo/clientĪdd the config nexmo config to config/services.php file: 'nexmo' => [ $mobileNumber = implode(" ", $postData) Ĭurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0) Ĭurl_setopt($ch, CURLOPT_SSL_VERIFYpeer, 0) public function sendMsg(Request $request) I tried to see the method implode () but no success. I tried to do a dd (' $ message ') and dd (' $ options') I get the values of my fields well but when sending I always have the same error. When sending I have this error in my browser "Array to string conversion" and the error shows this line " CURLOPT_POSTFIELDS => $postData "if someone can help me." Hi everyone I have a problem with my code I try to send a nexmo text to all the numbers in my database.
