PHPackages                             parables/arkesel-sdk - 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. parables/arkesel-sdk

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

parables/arkesel-sdk
====================

Unofficial Arkesel SDK For PHP/Laravel

v0.2.0(1y ago)1162[2 issues](https://github.com/Parables/arkesel-sdk/issues)MITPHPPHP ^8.1CI failing

Since Jul 7Pushed 6mo agoCompare

[ Source](https://github.com/Parables/arkesel-sdk)[ Packagist](https://packagist.org/packages/parables/arkesel-sdk)[ Docs](https://github.com/parables/arkesel-sdk)[ RSS](/packages/parables-arkesel-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (10)Used By (0)

Arkesel SDK
===========

[](#arkesel-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8eba0590b70e363a0fb8a3c0c1b8c97e5e9dd66250f955b58c0efef2de880002/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70617261626c65732f61726b6573656c2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/parables/arkesel-sdk)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/52da0f7231904928efb6c928d0ac78c63dcfd59ca1351f3e97ee4e3b895ddb49/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f70617261626c65732f61726b6573656c2d73646b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/parables/arkesel-sdk)[![StyleCI](https://camo.githubusercontent.com/b75f2fd7eced9ba133861f53f0e108a8dd1e2fc48a80b6070448d96b190b3c38/68747470733a2f2f7374796c6563692e696f2f7265706f732f373534383938362f736869656c64)](https://styleci.io/repos/510513476)[![SymfonyInsight](https://camo.githubusercontent.com/f95496ee0201fa5c59f60c232649e82fcee125bd137bc11e89320d1394682287/68747470733a2f2f696e73696768742e73796d666f6e792e636f6d2f70726f6a656374732f35303763373138392d373733322d343863332d623535632d3239353139386439633139332f6d696e692e737667)](https://insight.symfony.com/projects/507c7189-7732-48c3-b55c-295198d9c193)[![Quality Score](https://camo.githubusercontent.com/e44e95ec31e6fec66a4b8c8e04fa9275e727cbf83bb4a52730c521b3db02162e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f70617261626c65732f61726b6573656c2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/parables/arkesel-sdk)[![Code Coverage](https://camo.githubusercontent.com/e9324c0976689c8e14fa0ee9ccdb60397bc577acbbec7d75c79810dcf4808c7f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f70617261626c65732f61726b6573656c2d73646b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/parables/arkesel-sdk/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/d535860537dc1585b4a3087acdbb86187717bf9c404ce58cb57fb954307c16a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617261626c65732f61726b6573656c2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/parables/arkesel-sdk)

Contents
--------

[](#contents)

- [Arkesel SDK](#arkesel-sdk)
    - [Contents](#contents)
    - [About](#about)
    - [Features](#features)
    - [Installation](#installation)
        - [Setting up the Arkesel service](#setting-up-the-arkesel-service)
    - [Usage](#usage)
        - [Bulk SMS](#bulk-sms)
            - [Notifications to the `arkesel` channel](#notifications-to-the-arkesel-channel)
            - [SMS Recipients](#sms-recipients)
        - [Composing SMS](#composing-sms)
        - [Available methods](#available-methods)
            - [ArkeselMessageBuilder)](#arkeselmessagebuilder)
            - [ArkeselSms](#arkeselsms)
    - [FAQ](#faq)
        - [ArkeselChannel](#arkeselchannel)
    - [Changelog](#changelog)
    - [Testing](#testing)
    - [Security](#security)
    - [Contributing](#contributing)
    - [Credits](#credits)
    - [License](#license)

About
-----

[](#about)

This is an unofficial SDK for [Arkesel](https://arkesel.com/) which is a wrapper around \[Arkesel API\] for PHP and Laravel applications.

Features
--------

[](#features)

- Bulk SMS
- Payment
- Voice
- Email
- USSD

This SDK includes a Laravel Notification channel that makes it possible to send out Laravel notifications as a SMS using [Arkesel API](https://arkesel.com/)

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

[](#installation)

You can install this package via composer:

```
composer require parables/arkesel-sdk
```

The service provider gets loaded automatically.

Then publish the config file

```
php artisan vendor:publish --provider="Parables\ArkeselSdk\ArkeselServiceProvider" --tag="config"
```

### Setting up the Arkesel service

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

First, create [Sign up](https://account.arkesel.com/signup) for an account. You will be taken to your [SMS Dashboard](https://sms.arkesel.com/user/sms-api/info) where you can find the SMS API keys.

Then add your API key to the `.env` file

```
ARKESEL_SMS_API_KEY="your Arkesel API key"
```

The following env variables can be used to customize the package. Refer to the [Arkesel Docs](https://developers.arkesel.com/) for more info

```
ARKESEL_API_VERSION="v2" # or "v1"
ARKESEL_SMS_URL= # for SMS API v1, use 'https://sms.arkesel.com/sms/api`
ARKESEL_SMS_SENDER= # defaults to your `APP_NAME` env variable
ARKESEL_SMS_CALLBACK_URL= # for API SMS v2
ARKESEL_SMS_SANDBOX= # for API SMS v2
```

Usage
-----

[](#usage)

### Bulk SMS

[](#bulk-sms)

```
$builder = (new ArkeselMessageBuilder)
    ->message('Hello World')
    ->recipients(["233234567890", "233234567890"])
    ->recipients("233234567890,233234567890") // alternative
    ->sandbox(false);

// helper function
$response = arkeselSms(builder: $builder)->send();

// facade
$response = ArkeselSms::make(builder: $builder)->send();

// instance
$response = new ArkeselSms(builder: $builder)->send();
```

#### Notifications to the `arkesel` channel

[](#notifications-to-the-arkesel-channel)

Create a notification class. Refer to Laravel's documentation on [Notifications](https://laravel.com/docs/9.x/notifications).

1. Add the Notifiable trait to your model

    ```
