dotunj / laratwilio
A Laravel Package for sending SMS messages with Twilio
Installs: 6 296
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 7
Open Issues: 4
Requires
- twilio/sdk: ^5.42
Requires (Dev)
- orchestra/testbench: ^4.0
This package is auto-updated.
Last update: 2024-04-30 00:39:07 UTC
README
This is a Laravel package for sending SMS with Twilio
Step One - Installation
Require the package via composer into your project
composer require dotunj/laratwilio
Step Two - Publishing Configurations
To publish the config file, run:
php artisan vendor:publish --tag=laratwilio-config
This is the content of the config file that will be published at config/laratwilio.php
<?php return [ 'account_sid' => env('TWILIO_ACCOUNT_SID'), 'auth_token' => env('TWILIO_AUTH_TOKEN'), 'sms_from' => env('TWILIO_SMS_FROM'), ];
Next, edit your .env
file with your Twilio Credentials
TWILIO_ACCOUNT_SID=xxxx TWILIO_AUTH_TOKEN=xxxx TWILIO_SMS_FROM=xxxx
Usage
To send a SMS message, you can use the notify()
method available on the LaraTwilio
Facade
<?php use Dotunj\LaraTwilio\Facades\LaraTwilio; $sendSms = LaraTwilio::notify('+2341234567892', 'Hello') return $sendSms;
Contributing
Want to contribute to this package? Read our contributor guidelines to get set up.
License
This package is released under the MIT License.