PHPackages                             m-shule/africastalking - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. m-shule/africastalking

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

m-shule/africastalking
======================

AfricasTalking notifications driver for Laravel 5.3+

v2.0.3(5y ago)01.6k2MITPHPPHP &gt;=5.6.4CI failing

Since May 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/m-shule/africastalking)[ Packagist](https://packagist.org/packages/m-shule/africastalking)[ Docs](https://github.com/m-shule/africastalking)[ RSS](/packages/m-shule-africastalking/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

AfricasTalking notifications channel for Laravel 5.3+
=====================================================

[](#africastalking-notifications-channel-for-laravel-53)

This package makes it easy to send notifications using [AfricasTalking](https://africastalking.com/) with Laravel 5.3+.

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Installation](#installation)
    - [Setting up the AfricasTalking service](#setting-up-the-AfricasTalking-service)
- [Usage](#usage)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Requirements
------------

[](#requirements)

- [Sign up](https://account.africastalking.com/auth/register) for a free AfricasTalking account
- Create a new API Key under Settings in the Sandbox section

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require m-shule/africastalking
```

for Laravel 5.4 or lower, you must add the service provider to your config:

```
// config/app.php
'providers' => [
    ...
    MShule\AfricasTalking\AfricasTalkingServiceProvider::class,
],
```

### Setting up the AfricasTalking service

[](#setting-up-the-africastalking-service)

Add the environment variables to your `config/services.php`:

```
// config/services.php
...
'africastalking' => [
    'api_key' => env('AFRICASTALKING_API_KEY'),
    'username' => env('AFRICASTALKING_USERNAME'),
    'from' => env('AFRICASTALKING_FROM'),
],
...
```

Add your AfricasTalking API key, username, and from number/short code to your `.env`:

```
// .env
...
AFRICASTALKING_API_KEY=
AFRICASTALKING_USERNAME=
AFRICASTALKING_FROM=
...
```

The from variable is optional.

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
