PHPackages                             mminotti/smsdev - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mminotti/smsdev

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mminotti/smsdev
===============

Send and receive SMS using SmsDev.com.br

v0.4(4y ago)012MITPHPPHP &gt;=5.6

Since Jan 19Pushed 4y agoCompare

[ Source](https://github.com/Minotti/smsdev-php)[ Packagist](https://packagist.org/packages/mminotti/smsdev)[ RSS](/packages/mminotti-smsdev/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (5)Used By (0)

smsdev-php
==========

[](#smsdev-php)

[![Build Status](https://camo.githubusercontent.com/cf0f251743e68ff27ba588dffe605357b83ff79cddf67dab4dc2e9d186b6f5e1/68747470733a2f2f7472617669732d63692e636f6d2f656e7269636f646961732f736d736465762d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/enricodias/smsdev-php)[![Code Coverage](https://camo.githubusercontent.com/dbb62b90422e63403b6094876d2653d5b99e2e1e1d9245e1e8d9a0f9350fa526/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656e7269636f646961732f736d736465762d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/enricodias/smsdev-php/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/46be50f2950677d2a73d9ab57b4f637dcc7af7fd916e479e612e424beb9a4613/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656e7269636f646961732f736d736465762d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/enricodias/smsdev-php/?branch=master)[![Latest version](https://camo.githubusercontent.com/e8de7a533fa9ff01ee0aef12a51aea59511fd9dea60a6baa79f9ce4fdd64f0d9/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e7269636f646961732f736d736465762e737667)](https://packagist.org/packages/enricodias/smsdev)[![Downloads total](https://camo.githubusercontent.com/41f4baf6ce80e465a346391ea9fe0474e0f91bf9ebbba61d23e1b0087d7eab38/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e7269636f646961732f736d736465762e737667)](https://packagist.org/packages/enricodias/smsdev)[![License](https://camo.githubusercontent.com/8a0c9809099730b0889584949be4568b3f3d86ded251921e1fe43407dc51c5fc/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e7269636f646961732f736d736465762e737667)](https://github.com/enricodias/smsdev-php/blob/master/LICENSE)

Send and receive SMS using [SmsDev.com.br](https://www.smsdev.com.br)

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

[](#installation)

Require this package with Composer in the root directory of your project.

```
composer require enricodias/smsdev
```

Usage
-----

[](#usage)

Create a new instance with your API key:

```
$SmsDev = new \enricodias\SmsDev('API_KEY');
```

Set any date format to be used in all date methods:

```
$SmsDev->setDateFormat('Y-m-d H:i:s'); // default is 'U', timestamp
```

### Sending an SMS message

[](#sending-an-sms-message)

```
$SmsDev->send(5511988881111, 'SMS Message'); // returns true if the API accepts the message

var_dump($SmsDev->getResult()); // Returns the raw API response.
```

The country code optional. The default is 55 (Brazil).

#### Phone number validation

[](#phone-number-validation)

If you have the package [giggsey/libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php) installed, it will be used to validate numbers locally. You can disable this feature with the method `setNumberValidation` before sending:

```
$SmsDev->setNumberValidation(false); // disables phone number validation
```

Note that SmsDev will charge you for messages sent to invalid numbers.

### Receiving SMS messages

[](#receiving-sms-messages)

Get unread messages in a specific date interval:

```
$SmsDev->setDateFormat('Y-m-d');

$SmsDev->setFilter()
            ->isUnread()
            ->dateBetween('2018-01-19', '2019-01-19')
        ->fetch();
```

Search for a specific message id:

```
$SmsDev->setFilter()
            ->byId(2515974)
        ->fetch();
```

### Parsing the response

[](#parsing-the-response)

After fetching the messages you can either access the raw API response using `getResult()` or use the function `parsedMessages()` to get a simplified array:

```
$SmsDev->setDateFormat('U'); // timestamp

$messages = $SmsDev->parsedMessages();

var_dump($messages);

/*
array(1) {
    ['date']    => '1529418914'
    ['number']  => '5511988887777'
    ['message'] => 'Message'
}
*/
```

Dates are converted to the format specified in `setDateFormat()`.

### Date filters

[](#date-filters)

The following filters are equivalent:

```
$SmsDev->setFilter()
            ->dateBetween('2018-01-19', '2019-01-19')
        ->fetch();

$SmsDev->setFilter()
            ->dateBetween('2018-01-19', '')
            ->dateTo('2019-01-19')
        ->fetch();

$SmsDev->setFilter()
            ->dateBetween('', '2019-01-19')
            ->dateFrom('2018-01-19')
        ->fetch();

$SmsDev->setFilter()
            ->dateFrom('2018-01-19')
            ->dateTo('2019-01-19')
        ->fetch();
```

Timezone problems
-----------------

[](#timezone-problems)

The API uses the timezone America/Sao\_Paulo. Using another timezone in your application will force you to convert dates locally in order to get correct values.

> Ex: if you are using UTC-4 and receive a new message, it will look like the message came from the future because America/Sao\_Paulo is UTC-3.

This class solves this problem by automatically correcting dates both in search filters and in parsed messages. Only the dates in raw API responses are not converted.

TODO
----

[](#todo)

- Check the status of sent messages.
- Send multiple SMS messages.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~260 days

Total

4

Last Release

1577d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/57f08058b03c60394daf179fd4ca83c5d7a7b2bf97415873e949ce5a7039d6b5?d=identicon)[minotti](/maintainers/minotti)

---

Top Contributors

[![enricodias](https://avatars.githubusercontent.com/u/32619307?v=4)](https://github.com/enricodias "enricodias (44 commits)")[![Minotti](https://avatars.githubusercontent.com/u/17681478?v=4)](https://github.com/Minotti "Minotti (3 commits)")[![WesleyGoncalves](https://avatars.githubusercontent.com/u/29783839?v=4)](https://github.com/WesleyGoncalves "WesleyGoncalves (1 commits)")

---

Tags

smssmsdev

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mminotti-smsdev/health.svg)

```
[![Health](https://phpackages.com/badges/mminotti-smsdev/health.svg)](https://phpackages.com/packages/mminotti-smsdev)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k40](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66143.7k120](/packages/oat-sa-tao-core)

PHPackages © 2026

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