Download the PHP package mane-olawale/laravel-termii without Composer

On this page you can find all versions of the php package mane-olawale/laravel-termii. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-termii

Github Total Downloads Latest Stable Version License

Termii Laravel Package

A package for integrating termii services with your laravel application.

Uses Termii Client.

Requirements

Installation

Via Composer.

To get the latest version of Laravel Termii, simply run at the root of your laravel project.

After Composer has installed the Laravel termii package, you may run the termii:install Artisan command. This command publishes the configuration file of the package named termii.php:

Setup

Open your .env file and add your api key, sender id, channel and so on:

Basic usage

Send sms using the termii facade class

Services

You can access the client services directly by calling them as function on the facade class

Notification channel

This package provides you with a notification channel that enables you to send sms through the notification feature of laravel like so:

Create a notification class

Add termii channel to the notification

Add route to user So the notification channel can get the user`s phone number.

More on TermiiMessage

Working with the message content:

You can configure the sms sent through the notification channel by chaining methods to the TermiiMessage object like so:

Note

  • The default message type is unicode as at the time of writing, but you can use the TermiiMessage::type() method to set any type that may later be introduced.

  • If these configurations are not done the default configuration will be used.

Working with OTP

This package provides you with the appropriate tool to send and verify OTP in stateless or stateful request.

Stateful OTP

This package can send OTP within stateful requests, it relies on session to store the pin_id and other data by representing the it with a tag like so:

Note:

  • You can chain these methods together.
  • The Token::start() method will send the OTP and return self.

Stateless OTP

This package can send OTP within stateless requests, it relies on JWT to securely hold that data in an encrypted string:

Verifying OTP

Stateful OTP

Stateless OTP

In App OTP

You can create in app token by chaining the Token::inApp() method to your token like so:

More on OTP

You can retrieve some token properties after calling the Token::start() method:

Chaining methods

Testing

This package support TDD in so you can build fast with confidence.

Endpoint aliases

Endpoints are represented with aliases for easy mocking and asserting. these are the available aliases:

Alias Endpoint
sender api/sender-id
request api/sender-id/request
send api/sms/send
number api/sms/number/send
template api/send/template
otp api/sms/otp/send
verify api/sms/otp/verify
inapp api/sms/otp/generate
balance api/get-balance
search api/insight/number/query
inbox api/sms/inbox

Mocking and Sequence

Sequence Sequence lets you create a collection of responses that will start from the first element when the list is excusted.

Mocking with sequence

The example below will mock the send endpoint with a response.

Note: mocking works for all aliases and not only for send

Asserting

Assert no sent

Note: This works for all aliases and not only for send

Assert successful and Failed requests

In this example we will assert the endpoint responded with response code within the range of 100 - 299 or Not.

Note: This works for all aliases and not only for send

Deep Assertion

You can assert the request and response object deeper using the Termii::assert() method.

With Closure

Note:

  • This works for all aliases and not only for send
  • This only assert the first pair of request and response so if you want more assertion use Sequence below.

With Sequence

Fallback response

If you do not mork the endpoint that will be invoked in your application, the default fallback response will be an empty successful json response. but you can change it using the Termii::fallbackResponse()

Note Testing is important in your application. Every part of your application should be tested, most especially the part integrating with other systems that you do not maintain. This is why i take the pain of providing this package with TDD support so you can create and assert the behaviour of your laravel application just to make sure everything is working as it should. ~ Olawale


All versions of laravel-termii with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
mane-olawale/termii Version ^1.2
illuminate/notifications Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mane-olawale/laravel-termii contains the following files

Loading the files please wait ....