PHPackages                             samrap/teleapi-sms - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. samrap/teleapi-sms

ActiveLibrary[Queues &amp; Workers](/categories/queues)

samrap/teleapi-sms
==================

Teleapi SMS package.

v0.1.0(9y ago)11[1 issues](https://github.com/samrap/teleapi-sms/issues)MITPHPPHP &gt;=5.6

Since Jan 14Pushed 9y agoCompare

[ Source](https://github.com/samrap/teleapi-sms)[ Packagist](https://packagist.org/packages/samrap/teleapi-sms)[ RSS](/packages/samrap-teleapi-sms/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Teleapi SMS
===========

[](#teleapi-sms)

![Travis branch](https://camo.githubusercontent.com/88023078ec2b2a74e9fc9b4e65cad5ba533a4acc033dd41a9d943d06ed44b6cf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73616d7261702f74656c656170692d736d732f6d61737465722e7376673f7374796c653d666c61742d737175617265)[![StyleCI](https://camo.githubusercontent.com/5801e6353db9ed7fc1d9fcad2f088f7dfec778aa86ba81702ed12dbb73fc766b/68747470733a2f2f7374796c6563692e696f2f7265706f732f37383931393033332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/78919033)

This package provides a fluent interface to the Teleapi SMS service.

### Installation

[](#installation)

Install via Composer:

`composer require samrap/teleapi-sms`

### Usage

[](#usage)

The Teleapi SMS package provides two classes which allow you to easily create and send text messages over HTTP.

#### The Client

[](#the-client)

The Client is used to send text messages to the Teleapi SMS service. The HTTP implementation is abstracted using httplug, allowing you to define any [PSR-7](http://www.php-fig.org/psr/psr-7/) compliant client or [adapter](http://docs.php-http.org/en/latest/clients.html) as the HTTP layer. This gives you full control over how requests are sent and allows you to easily mock API requests in unit tests.

To get started, you will need to choose the HTTP client you want to use. We recommend using the PHP HTTP [CURL Client](https://github.com/php-http/curl-client) for simple applications and [Guzzle](https://github.com/guzzle/guzzle) for more complex apps. Of course, any PSR-7 compliant library can be used. In this example we will use the CURL Client.

First, we will add the CURL Client to our requirements:

`composer require php-http/curl-client`

Now that our HTTP client is installed, we can instantiate and use our SMS client:

```
use Teleapi\Sms\Client;

$client = new Client('api_token');
```

We have now created our SMS client which is ready for use. Notice how we did not specify the HTTP client to use. Behind the scenes, the SMS client searches for any installed package that provides a `php-http/client-implementation` and loads it automagically. This will only work for some clients, it is better practice to specify the HTTP client explicitly. Have a look at [Clients and Adapters](http://docs.php-http.org/en/latest/clients.html) in the PHP HTTP documentation on how to instantiate a client. Then, simply pass it as the second argument to the SMS Client's constructor:

```
use Teleapi\Sms\Client;

// Some code to create our HTTP client...

$client = new Client('api_token', $httpClient);
```

In any case, we are now ready to use our SMS client, so let's create a Message and send it off!

All messages are represented by the `Teleapi\Sms\Message` class and are extremely simple to create:

```
use Teleapi\Sms\Message;

$to = '7148675309';
$from = '7141234567';
$text = 'Welcome to our amazing product!';
$message = new Message($to, $from, $text);
```

Now, we can send the message on its way by calling the client's `send` method and passing the Message as its single argument:

```
$client->send($message);
```

We can check if the message sent successfully by calling the its `sent` method:

```
$client->send($message);

if ($message->sent()) {
    echo 'Successfully sent message!';
}
```

A complete example might look like the following:

```
use Teleapi\Sms\Client;

// Some code to create our HTTP client...

$client = new Client('api_token', $httpClient);
$message = new Message(
    '7148675309',
    '7141234567',
    'Welcome to our amazing product!'
);

$client->send($message);

if ($message->sent()) {
    echo 'Successfully sent message!';
}
```

More info &amp; features coming soon!
-------------------------------------

[](#more-info--features-coming-soon)

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3453d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78e66e2a9fc45b509f43164b07af8521a71941b081abfbbaec6597bd6d4f4a21?d=identicon)[samrap](/maintainers/samrap)

---

Tags

messagephpsmsteleapi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/samrap-teleapi-sms/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[php-http/httplug-bundle

Symfony integration for HTTPlug

38921.5M59](/packages/php-http-httplug-bundle)[florianv/exchanger

PHP exchange rate provider layer for currency conversion: 30 services, chain fallback, and caching.

1864.9M20](/packages/florianv-exchanger)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k6](/packages/theodo-group-llphant)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3845.9M26](/packages/gotenberg-gotenberg-php)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28146.3k](/packages/phpro-http-tools)

PHPackages © 2026

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