PHPackages                             nextsms/php-client - 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. [API Development](/categories/api)
4. /
5. nextsms/php-client

ActiveLibrary[API Development](/categories/api)

nextsms/php-client
==================

Nextsms for PHP

0.0.4(4y ago)41.1k↓100%2[4 PRs](https://github.com/nextsms/php-client/pulls)1MITPHPPHP &gt;=7.2CI passing

Since May 11Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/nextsms/php-client)[ Packagist](https://packagist.org/packages/nextsms/php-client)[ Docs](https://github.com/nextsms/php-client)[ RSS](/packages/nextsms-php-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (11)Used By (1)

Nextsms for PHP
===============

[](#nextsms-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7cef280ee74bf23461e3bf7346e3def44f7c342824ffad2bdfd76d456d4e5923/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e657874736d732f7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nextsms/php-client) [![Tests](https://github.com/nextsms/php-client/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/nextsms/php-client/actions/workflows/run-tests.yml) [![Total Downloads](https://camo.githubusercontent.com/4e6735f8eb4fe30d4e10fcdba7eea1fb61e5b4010a2c34f6e700ff5c6b61895a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e657874736d732f7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nextsms/php-client) [![Check & fix styling](https://github.com/nextsms/php-client/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/nextsms/php-client/actions/workflows/php-cs-fixer.yml)

The `Nextsms for PHP` makes it easy for developers to access Nextsms services in their PHP code, and build robust applications and software using services like Bulk SMS delivery, Sub customers, and more.

> **V2:** You are currently viewing the documentation for the NextSMS PHP SDK V2. If you are looking for the documentation for the V1 SDK, you can find it [here](#).

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

[](#installation)

> **Requirement:** PHP 8.0 or higher is required.

You can install the package via Composer:

```
composer require nextsms/php-client
```

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';

use Nextsms\Nextsms;

$client = Nextsms::create(
    username: 'YOUR_USERNAME',
    password:  'YOUR_PASSWORD',
    from: 'NEXTSMS'
);

$helloMessage = $client->messages()->send([
    "to": '2557123456789',
    "text": 'Hello World',
    // from is optional if you have set it in the constructor
]);
// Or
$message = Message::create(text: 'Hello World',to: '2557123456789');

$helloMessage = $client->messages()->send($message);

// Send Later
$messageScheduled = $client->messages()->sendLater(
    new Message(to: '2557123456789', text: 'Hello World'),
    \DateTime::createFromFormat('Y-m-d', '2020-12-31')
);

// Send to many
$manyMessages = $client->messages()->sendMany(
    MessageCollection::create([
        Message::text(to: '2557123456789', text: 'Hello World'),
        Message::text(to: '2557123456789', text: 'Hello World'),
    ])
);
// Or
$manyMessages = $client->messages()->sendMany(
    MessageCollection::create([
        Message::text(to: '2557123456789', text: 'Hello World'),
        Message::text(to: [ '2557123456789', '2557123456789' ], text: 'Hello World'),
    ]);
);

// Delivery reports
$allReports = $client->reports()->all();

// Query
$reports = $client->reports()
    ->query()
    // Using date string
    ->sentFrom(date: '01-01-2022')
    // Or using date object
    ->sentUntil(date: \DateTime::create('now'))
    ->get();

$report = $client->reports()->get($messageId);
//

// Customer
$customer = Customer::create([
    "first_name" => "Api",
    "last_name" => "Customer",
    "username" => "api_customer",
    "email" => "apicust@customer.com",
    "phone_number" => "0738234339",
    "account_type" => "Sub Customer (Reseller)",
    "sms_price" => 200
]);

// Create
$customer = $client->customers()->create($customer);

// Recharge
$recharge = $client->customers()->recharge($customer, 1000);

// Deduct
$deduct = $client->customers()->deduct($customer, 1100);
```

Testing
-------

[](#testing)

Using [Pest framework](http://pestphp.com).

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](./.github/CONTRIBUTING.md) for details.

Star this repository
--------------------

[](#star-this-repository)

If you enjoy this package, please star this repository to encourage further development.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Alpha Olomi](https://github.com/nextsms)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance53

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~138 days

Recently: every ~172 days

Total

6

Last Release

1135d ago

Major Versions

0.x-dev → 1.x-dev2023-02-02

1.x-dev → 2.x-dev2023-04-01

PHP version history (3 changes)v0.0.2PHP ^7.4|^8.0

0.0.4PHP &gt;=7.2

1.x-devPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7534dd7341d883267be41935354b56c27f94d6bbd6a7abd9f257bb2d494a3798?d=identicon)[alphao](/maintainers/alphao)

---

Top Contributors

[![alphaolomi](https://avatars.githubusercontent.com/u/10551599?v=4)](https://github.com/alphaolomi "alphaolomi (54 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (18 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (10 commits)")

---

Tags

nextsmsphpapibulk-smsnextsms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nextsms-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/nextsms-php-client/health.svg)](https://phpackages.com/packages/nextsms-php-client)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[get-stream/stream-chat

A PHP client for Stream Chat (https://getstream.io/chat/)

301.8M2](/packages/get-stream-stream-chat)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
