Code Monkey home page Code Monkey logo

laravel-unifonic's Introduction

Laravel Unifonic 8.x +

Start sending SMS with Unifonic right away using Laravel.

Total Downloads Latest Stable Version License


Installation

First, install the package through Composer.

$ composer require multicaret/laravel-unifonic

Laravel 5.5 and up

You don't have to do anything else, this package uses the package Auto-Discovery feature, and should be available as soon as you install it via Composer.

Laravel 5.4 and below

Then include the service provider inside config/app.php.

'providers' => [
    ...
    Multicaret\Unifonic\UnifonicServiceProvider::class,
    ...
];

And add the alias as well

'aliases' => [
    ...
    'Unifonic' => Multicaret\Unifonic\UnifonicFacade::class,
    ...
],

Configurations

Head to Dashboard to create a new Application (check image below if you wish). Within in this app, you will find the APP SID copy it please. Now add these to your config/services.php file:

'unifonic' => [
    'app_id' => env('UNIFONIC_APP_ID'),
    'sender_id' => env('UNIFONIC_SENDER_ID'), // String, Optional
    'account_email' => env('UNIFONIC_ACCOUNT_EMAIL'),
    'account_password' => env('UNIFONIC_ACCOUNT_PASSWORD')
],

Now Place these in your .env file.

UNIFONIC_APP_ID=
UNIFONIC_SENDER_ID=
UNIFONIC_ACCOUNT_EMAIL=
UNIFONIC_ACCOUNT_PASSWORD=

Usage

Account related methods:

// To test credentials and make sure the APP SID, email & password are set correctly. 
Unifonic::retrieveCredentialsForTesting();

Messages related methods:

Unifonic::send(int $recipient, string $message, string $senderID = null);
Unifonic::getMessageIDStatus(int $messageID);

You may make asynchronous calls to Unifonic API, by prefixing your methods with the async() function:

Unifonic::async(true); // async calls on, default value is true
Unifonic::async(false);// async calls off

// Later you can append the callback() to be executed when the response returns.
Unifonic::async()->callback(Callable $requestCallback); 

For more details about the parameters please refer to the Api Documentation for more info, or read the source code.

Contributing

See the CONTRIBUTING guide.

Changelog

Please see CHANGELOG for more information about what has changed recently.

laravel-unifonic's People

Contributors

mkwsra avatar mahmoudqassass avatar muhammedkamel avatar

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.