Download the PHP package samuelmwangiw/africastalking-laravel without Composer

On this page you can find all versions of the php package samuelmwangiw/africastalking-laravel. 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 africastalking-laravel

africastalking-laravel

Latest Version on Packagist run-tests PHPStan Code styling Total Downloads

This is an unofficial Laravel SDK for interacting with Africa's Talking APIs that takes advantage of native Laravel components such as

Installation

You can install the package via composer:

You can publish the config file with:

This is the contents of the published config file:

You should configure the package by setting the env variables in your .env file.

Usage

Application Balance

Bulk Messages

The most basic example to send out a message is

Other valid examples are

The response is Collection of \SamuelMwangiW\Africastalking\ValueObjects\RecipientsApiResponse objects

Premium Messages

The response is Collection of \SamuelMwangiW\Africastalking\ValueObjects\RecipientsApiResponse objects

Airtime

The most basic example to disburse airtime is

You may also pass an instance of AirtimeTransaction

The Airtime class provides an add() that's basically an alias to the to() and since either of these methods can be fluently chained, it unlocks capabilities such as adding the recipients in a loop and sending once at the end

USSD Response

This package allows to easily create USSD response by exposing a \SamuelMwangiW\Africastalking\Response\UssdResponse class that implements Laravel's Responsable contract.

To send a ussd response, simply return africastalking()->ussd() in your controller.

The ussd optionally takes 2 parameters and returns an instance of UssdResponse:

The UssdResponse class has the following methods that can be chained fluently

See below an example controller that makes of the UssdResponse and Ussd's HttpRequest:

Payments (wip)

Mobile Checkout

Wallet Balance

Stash top up

Voice Responses

This package provides an easy and intuitive voice response builder that allows any combination of the following:

Note that all params marked as optional in the documentation are also optional

See example in a controller below:

Synthesized Speech Attributes.

The action supports the use of Speech Synthesis Markup Language(SSML).

To respond with Synthesized Speech, pass a callback say() above as the first parameter that receives an instance of object

Note You can only have a single within an XML response

Making Calls

WebRTC

HTTP Requests

The package ships with the following Laravel Requests that you can inject into your application controllers:

In addition to exposing the post params in a nice FormRequest object, these classes also include nice helper methods where applicable e.g.

Example for a Message Delivery callback action Controller

Notification

The package ships with a Channel to allow for easily routing of notifications via Africastalking SMS.

To route a notification via Africastalking, return SamuelMwangiW\Africastalking\Notifications\AfricastalkingChannel in your notifications via method and the text message to be sent in the toAfricastalking method

Also ensure that the notifiable model implements SamuelMwangiW\Africastalking\Contracts\ReceivesSmsMessages and that the model's routeNotificationForAfricastalking() returns the phone number to receive the message

Testing

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of africastalking-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0|^11.0
saloonphp/laravel-plugin Version ^3.5
spatie/laravel-package-tools Version ^1.14
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 samuelmwangiw/africastalking-laravel contains the following files

Loading the files please wait ....