PHPackages                             labsmobile/sms-php - 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. labsmobile/sms-php

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

labsmobile/sms-php
==================

Send SMS messages through the LabsMobile platform and the PHP library.

1.0.2(1y ago)15.1k↑14.7%MITPHPPHP &gt;=5.4.0, &lt;=8.3.19

Since Dec 26Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (3)Used By (0)

 [![](https://avatars.githubusercontent.com/u/152215067?s=200&v=4)](https://avatars.githubusercontent.com/u/152215067?s=200&v=4)

LabsMobile-PHP
==============

[](#labsmobile-php)

[![](https://camo.githubusercontent.com/2f97a2b4477732b5b4d663facb8646dad6a0e89db9abdee649d5ef733a65da66/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e322d626c75652e737667)](https://camo.githubusercontent.com/2f97a2b4477732b5b4d663facb8646dad6a0e89db9abdee649d5ef733a65da66/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e322d626c75652e737667)

Send SMS messages through the LabsMobile platform and the PHP library.

Documentation
-------------

[](#documentation)

- Labsmobile API documentation can be found [here](https://apidocs.labsmobile.com/).

Features
--------

[](#features)

- Send SMS messages.
- Get account credits
- Get prices by country
- Manage scheduled sendings
- HLR Request (Check mobile)

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

[](#requirements)

- A user account with LabsMobile. Click on the link to create an account [here](https://www.labsmobile.com/en/signup).
- This library supports php v5.4 and higher versions of php.
- From php v5.4 to php v7.1 it is recommended to use [Composer 2.2.22](https://getcomposer.org/download/).

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

[](#installation)

To install the [labsmobile/sms-php](https://packagist.org/packages/labsmobile/sms-php) library, it is recommended to use [composer](https://getcomposer.org/).

### Installation command

[](#installation-command)

```
composer require labsmobile/sms-php

```

### Installation by modifying the composer.json file

[](#installation-by-modifying-the-composerjson-file)

```
"require": {
	"labsmobile/sms-php": "1.0.2"
}

```

Examples of use cases
---------------------

[](#examples-of-use-cases)

**Send SMS**

Here is an example of using the library to send a SMS:

```
  public $username = 'myusername';
  public $token = 'mytoken';

  public function testSms()
  {
    try {
      $message = 'Test SMS';
      $phone = ['34XXXXXXXXX'];
      $labsMobileClient = new LabsMobileClient($this->username, $this->token);
      $bodySms = new LabsMobileModelTextMessage($phone,$message);
      $labsMobileClient = $labsMobileClient->sendSms($bodySms);
      $body = $labsMobileClient->getBody();
      $json = json_decode($body);
      self::assertSame('0',$json->code);
    } catch (RestException $exception) {
      self::assertSame('Error', $exception->getStatus() ." ". $exception->getMessage());
    }
  }
```

**Get account credits**

Here is an example to learn credits for an existing account:

```
  public $username = 'myusername';
  public $token = 'mytoken';

  public function testGetCredits()
  {
    try{
      $labsMobileClient = new LabsMobileClient($this->username, $this->token);
      $response = $labsMobileClient->getCredit();
      $body = $response->getBody();
      $json = json_decode($body);
      self::assertSame(0,$json->code);
    } catch(RestException $exception) {
      self::assertSame('Error', $exception->getStatus() ." ". $exception->getMessage());
    }
  }
```

**Manage scheduled sendings**

Here is an example you can cancel or execute the scheduled sendings that are pending for execution:

```
  public $username = 'myusername';
  public $token = 'mytoken';

  public function testScheduledSendings()
  {
    try {
      $subid="XXXXXXXXXX";
      $cmd="XXXX";
      $labsMobileClient = new LabsMobileClient($this->username, $this->token);
      $bodyScheduled = new LabsMobileModelScheduledSendings($subid, $cmd);
      $labsMobileClient = $labsMobileClient->scheduledSendings($bodyScheduled);
      $body = $labsMobileClient->getBody();
      $json = json_decode($body);
      self::assertSame(0,$json->code);
    } catch (RestException $exception) {
      self::assertSame('Error', $exception->getStatus() ." ". $exception->getMessage());
    }
  }
```

**Get prices by country**

Here is an example to know the credits that a single sending will take depending on the country of delivery:

```
  public $username = 'myusername';
  public $token = 'mytoken';

  public function testCountryPrice()
  {
    try {
      $countries = ["CO","ES"];
      $labsMobileClient = new LabsMobileClient($this->username, $this->token);
      $bodyContries = new LabsMobileModelCountryPrice($countries);
      $labsMobileClient = $labsMobileClient->getpricesCountry($bodyContries);
      $body = $labsMobileClient->getBody();
      self::assertTrue(true, $body);
    } catch (RestException $exception) {
      self::assertSame('Error', $exception->getStatus() ." ". $exception->getMessage());
    }

  }
```

**HLR Request**

Here is an example queries the mobile phone status with the related information like current operator, format, active, ported information, subscription country, etc:

```
public $username = 'myusername';
  public $token = 'mytoken';

  public function testHlr()
  {
    try {
      $numbers = [];//[34XXXXXXXX,34XXXXXXXX]
      $labsMobileClient = new LabsMobileClient($this->username, $this->token);
      $bodyHlr = new LabsMobileModelHlrRequest(json_encode($numbers));
      $labsMobileClient = $labsMobileClient->hlrRequest($bodyHlr);
      $body = $labsMobileClient->getBody();
      $json = json_decode($body);
      self::assertSame('ok', $json->result);
    } catch (RestException $exception) {
      self::assertSame('Error', $exception->getStatus() ." ". $exception->getMessage());
    }
  }
```

Help
----

[](#help)

If you have questions, you can contact us through the support chat or through the support email .

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance45

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~442 days

Total

2

Last Release

431d ago

PHP version history (2 changes)1.0.1PHP &gt;=5.4.0, &lt;=8.3.0

1.0.2PHP &gt;=5.4.0, &lt;=8.3.19

### Community

Maintainers

![](https://www.gravatar.com/avatar/03361bd1de55d39c60a2eca6c98831f3b5905546367114a4615e3571db6684eb?d=identicon)[oscar-del](/maintainers/oscar-del)

---

Top Contributors

[![oesantaa](https://avatars.githubusercontent.com/u/110862250?v=4)](https://github.com/oesantaa "oesantaa (12 commits)")

---

Tags

libraryphpsmssms-apisms-gatewayphpcomposersmssms apihttpclientsmsapilabsmobilesms-clientsms-notificationssms-messagessms-php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/labsmobile-sms-php/health.svg)

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

###  Alternatives

[ferdous/laravel-otp-validate

Laravel package for OTP validation with built-in features like retry and resend mechanism. Built in max retry and max resend blocking. OTP/Security Code can be send over SMS or Email of your choice with user-defined template.

7124.4k](/packages/ferdous-laravel-otp-validate)[djunehor/laravel-sms

Send SMS from your laravel application

385.3k1](/packages/djunehor-laravel-sms)

PHPackages © 2026

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