Laravel with Twilio Integration
Begin by installing this package through Composer. Run this command from the Terminal:
composer require 2hmad/laravel-twilio
to publish the config file, run:
php artisan vendor:publish --tag=laraveltwilio-config
This is the content of the config file that will be published at config/laraveltwilio.php
Next, edit your .env
file with your Twilio Credentials
TWILIO_ACCOUNT_SID=xxxx
TWILIO_AUTH_TOKEN=xxxx
TWILIO_SMS_FROM=xxxx
To send a SMS message, you can use the notify()
method available on the LaravelTwilio
Facade
<?php
use Dot2hmad\LaravelTwilio\Facades\LaravelTwilio;
$sendSms = LaravelTwilio::notify('+2341234567892', 'Hello')
return $sendSms;
laravel-twilio is open-sourced software licensed under the MIT license