Please follow this steps and you are live with in a mere seconds.
- On notification classes add SMS channel on the like this.
public function via(object $notifiable): array { return ['sms', '...other channel']; }
- On the
.env
file please add this configuration.SMS_LOG=false SMS_DRIVER="twilio" SMS_ACCOUNT_MODE="sandbox" SMS_FROM_NAME="${APP_NAME}"
Depending on driver option you choose, add these API credentials after existing general configuration variables.
Driver | Credentials | Region | Configured | Tested |
---|---|---|---|---|
africastalking |
SMS_AFRICA_TALKING_API_KEY=null SMS_AFRICA_TALKING_USERNAME=null |
GLOBAL | ✅ | ❌ |
clickatell |
SMS_CLICKATELL_API_KEY=null |
GLOBAL | ✅ | ❌ |
clicksend |
SMS_CLICKSEND_USERNAME=null SMS_CLICKSEND_PASSWORD=null |
GLOBAL | ✅ | ❌ |
infobip |
SMS_INFOBIP_API_TOKEN=null |
GLOBAL | ✅ | ✅ |
messagebird |
SMS_MESSAGE_BIRD_ACCESS_KEY=null |
GLOBAL | ✅ | ❌ |
smsbroadcast |
SMS_SMSBROADCAST_USERNAME=null SMS_SMSBROADCAST_PASSWORD=null |
GLOBAL | ✅ | ❌ |
telnyx |
SMS_TELNYX_API_TOKEN=null |
GLOBAL | ✅ | ❌ |
twilio |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
GLOBAL | ✅ | ❌ |
smsapi |
SMS_SMSAPI_API_TOKEN=null |
GLOBAL | ✅ | ❌ |
Driver | Credentials | Region | Configured | Tested |
---|---|---|---|---|
adn |
SMS_ADN_API_KEY=null SMS_ADN_API_SECRET=null |
BAN | ✅ | ❌ |
ajuratech |
SMS_AJURATECH_API_KEY=null SMS_AJURATECH_SECRET_KEY=null |
BAN | ✅ | ❌ |
alpha |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
banglalink |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
bdbulksms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
boomcast |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
brilliant |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
bulksmsbd |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
customgateway |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
dianahost |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
dianasms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
dnsbd |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
elitbuzz |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
esms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
grameenphone |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
greenweb |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
lpeek |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
mdl |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
metronet |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
mimsms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
mobireach |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
mobishasra |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
muthofun |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
novocombd |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
onnorokom |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
quicksms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
redmoitsms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
smartlabsms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
sms4bd |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
smsnet24 |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
smsnoc |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
smsinbd |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
smsnetbd |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
smsq |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
ssl |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
tense |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
trubosms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
twentyfoursmsbd |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
viatech |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
twenty4bulksms |
SMS_TWILIO_USERNAME=null SMS_TWILIO_PASSWORD=null |
BAN | ❌ | ❌ |
On the notification class the via()
method will look like this
after adding the sms channel
public function via(object $notifiable): array
{
return ['sms', '...other'];
}
OR
use Laraflow\Sms\SmsChannel;
public function via(object $notifiable): array
{
return [SmsChannel::class, '...other'];
}
And the message prepare method should be named toSms
and
return type is SmsMessage
class instance.
Such example is given below.
use Laraflow\Sms\SmsMessage;
public function toSms(object $notifiable): SmsMessage
{
return (new SmsMessage)
->to('88012345678910')
->message('Hello from Laraflow SMS')
->vendor('telnyx') //Optional, will overwrite config file
->from('Laraflow'); //Optional, will overwrite config file
}