Skip to content

kaitoj/laratwilio

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 3 commits ahead of Dotunj:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

Introduction

This is a Laravel package for sending SMS with Twilio

Step One - Installation

Require the package via composer into your project

Add the repositories object to your composer.json file then run composer update.

"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/kaitoj/laratwilio.git"
        }
    ],
    
composer update

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.

About

A Laravel Package for sending SMS messages with Twilio

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%