dotunj/laratwilio

There is no license information available for the latest version (1.0.0) of this package.

A Laravel Package for sending SMS messages with Twilio

1.0.0 2020-02-03 01:10 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.