Giter Site home page Giter Site logo

laravel-sms's Introduction

Beem.africa SMS package for Laravel

Latest Version on Packagist Total Downloads

This package makes it easy to send messages using Beem.africa with Laravel.It is basicly a wrapper around their API.

Installation

You can install the package via composer:

composer require keenops/laravel-sms

After installation, publish the configuration files by running the command:

php artisan vendor:publish --tag=laravel-beem-sms

Usage

Add beem.africa API credentials. Can be obtained here

    BEEM_API_KEY=
    BEEM_API_SECRET=
    BEEM_SENDER_NAME=

Sending SMS

In your controller use like this

namespace App\Http\Controllers;

use Keenops\Sms\Facades\Sms;

class SMSController extends Controller
{
    public function index()
    {
        $message = "Hello Word"; //String
        
        $recipients = ['255701000001', '255701000002', '25570100003']; //array
 
        return Sms::send($message, $recipients);
        //returns a json value with sent status

    }
}

Checking SMS Balance

In your controller use like this

namespace App\Http\Controllers;

use Keenops\Sms\Facades\Sms;

class SMSController extends Controller
{
    public function index()
    {
 
        return Sms::viewBalance();
        //returns Integer value of the remaining balance E.g 210
    }
}

List sender names

In your controller use like this

namespace App\Http\Controllers;

use Keenops\Sms\Facades\Sms;

class SMSController extends Controller
{
    public function index()
    {
 
        return Sms::senderNames();
        //returns json list of registered sender name E.g 210
    }
}

Request a new sender name

In your controller use like this

namespace App\Http\Controllers;

use Keenops\Sms\Facades\Sms;

class SMSController extends Controller
{
    public function index()
    {
 
        return Sms::requestNewSenderName('API TEST','This is test api for new sender name using laravel beem package');
        //return json value of the new requested sender name

    }
}

Errors

Specific error codes may be displayed within parenthesis when send or receive operations fail. The most common of these error codes are specified on beem.africa API Documetation

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-sms's People

Stargazers

Alpha Olomi avatar Raphael Peter Olomi avatar

Watchers

Kee Nops avatar Raphael Peter Olomi avatar

Forkers

nickyraph

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.