PHPackages                             appslabke/laravel-notification-channels-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. appslabke/laravel-notification-channels-africastalking

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

appslabke/laravel-notification-channels-africastalking
======================================================

This package makes it easy to send notifications via AfricasTalking with Laravel

v2.4.1(5y ago)0128MITPHPPHP ^7.2.5

Since Mar 17Pushed 5y agoCompare

[ Source](https://github.com/marvinhosea/africastalking)[ Packagist](https://packagist.org/packages/appslabke/laravel-notification-channels-africastalking)[ Docs](https://github.com/laravel-notification-channels/africastalking)[ RSS](/packages/appslabke-laravel-notification-channels-africastalking/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (7)Versions (11)Used By (0)

AfricasTalking notification channel for Laravel
===============================================

[](#africastalking-notification-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/79b40f8611b825b661333fc853dd3dbe0852103619f069ea87cbc4ec1647663d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6166726963617374616c6b696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/africastalking)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![StyleCI](https://camo.githubusercontent.com/ba98d3d33035834c68a60ea7220a17232d108d07080419187cb25e993c198051/68747470733a2f2f7374796c6563692e696f2f7265706f732f3234373534383133302f736869656c64)](https://styleci.io/repos/209406724)[![Quality Score](https://camo.githubusercontent.com/9042971ef51521906542bd0ad73596d123754bc31b0253c822dc0d9ead5bdb4c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6166726963617374616c6b696e672e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/africastalking)[![Total Downloads](https://camo.githubusercontent.com/c04433585d16b319adcea26ecb46a8b61e13fca424e0085ac4f1969d8a1fb6c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f6166726963617374616c6b696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/africastalking)

This package makes it easy to send notifications using [AfricasTalking](https://build.at-labs.io/docs/sms%2Fsending) with Laravel.

Contents
--------

[](#contents)

- [About](#about)
- [Installation](#installation)
- [Setting up the AfricasTalking service](#setting-up-the-africastalking-service)
- [Usage](#usage)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

About
-----

[](#about)

This package is part of the [Laravel Notification Channels](http://laravel-notification-channels.com/) project. It provides additional Laravel Notification channels to the ones given by [Laravel](https://laravel.com/docs/master/notifications) itself.

The AfricasTalking channel makes it possible to send out Laravel notifications as a `SMS ` using AfricasTalking API.

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

[](#installation)

You can install this package via composer:

```
composer require laravel-notification-channels/africastalking
```

The service provider gets loaded automatically.

### Setting up the AfricasTalking service

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

You will need to [Register](https://account.africastalking.com/auth/register/) and then go to your sandbox app [Go To SandBox App](https://account.africastalking.com/apps/sandbox). [Click on settings](https://account.africastalking.com/apps/sandbox/settings/key) Within this page, you will generate your `Username and key`. Place them inside your `.env` file. Remember to add your Sender ID that you will be using to send the messages.

```
AT_USERNAME=""
AT_KEY=""
AT_FROM=""
```

To load them, add this to your `config/services.php` . This will load the AfricasTalking data from the `.env` file.file:

```
'africastalking' => [
    'username'      => env('AT_USERNAME'),
    'key'           => env('AT_KEY'),
    'from'          => env('AT_FROM'),
]
```

Add the `routeNotifcationForAfricasTalking` method on your notifiable Model. If this is not added, the `phone_number` field will be automatically used.

```
