Framework: Laravel 4.2
API: Nexmo
Library: christian-giupponi/nexmo https://github.com/ChristianGiupponi/Laravel-4-Nexmo
I have already deposit $10 in my account which means its not demo anymore.
<?php
$response = Nexmo::sendSMS('Amazon Company', $text_data['contact_number'], $text_data['text']);
$response = json_decode($response);
if(isset($response->body->messages[0]->{'error-text'}))
{
return array(
'status' => 'fail',
'response' => $response->body->messages[0]->{'error-text'}
);
}
return array(
'status' => 'success'
);
?>
My research:
To send SMS to US numbers, You have to request short code or you have to registered long number. For more details you can check my answer on following link:
https://stackoverflow.com/a/33035811/3077339
Hope this will help you.