PHPackages                             allanvb/laravel-semysms - 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. allanvb/laravel-semysms

ActiveLibrary

allanvb/laravel-semysms
=======================

SemySMS integration for Laravel

1.0.9(5y ago)54.2k↓33.3%3MITPHPPHP &gt;=7.1

Since Sep 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/allanvb/laravel-semysms)[ Packagist](https://packagist.org/packages/allanvb/laravel-semysms)[ Docs](https://github.com/allanvb/laravel-semysms)[ RSS](/packages/allanvb-laravel-semysms/feed)WikiDiscussions master Synced 1mo ago

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

 Laravel package for SMS mailing service SemySMS
-------------------------------------------------

[](#----laravel-package-for-sms-mailing-service-semysms)

 [![Packagist Version](https://camo.githubusercontent.com/b23c385900adec8655ea046ccc20e1a763d01ca2b07e69bb1e102ca7b906b179/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6c616e76622f6c61726176656c2d73656d79736d733f636f6c6f723d6f72616e6765267374796c653d666c61742d737175617265)](https://packagist.org/packages/allanvb/laravel-semysms) [![GitHub last commit](https://camo.githubusercontent.com/0368ff0e51df295552996936d3140cd054eba41d993eec3d3fadbcd6b8556c5e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f616c6c616e76622f6c61726176656c2d73656d79736d733f636f6c6f723d626c7565267374796c653d666c61742d737175617265)](https://packagist.org/packages/allanvb/laravel-semysms) [![License](https://camo.githubusercontent.com/bb8896ea40311c8cd7003ed406c41c11cf97389d2172e8acddc7db67fc1731c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616c6c616e76622f6c61726176656c2d73656d79736d733f636f6c6f723d627269676874677265656e267374796c653d666c61742d737175617265)](https://packagist.org/packages/allanvb/laravel-semysms) [![Sonar](https://camo.githubusercontent.com/fdbca14c647bd510e94d6b3ab73dd8d655bdfede94efcf2c1df1f75ca927f3aa/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d616c6c616e76625f6c61726176656c2d73656d79736d73266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard/index/allanvb_laravel-semysms)

Package that integrates [SemySMS](http:/semysms.net) API into your Laravel 5 app.

Installation:
-------------

[](#installation)

```
composer require allanvb/laravel-semysms
```

#### Laravel 5.5+

[](#laravel-55)

If you're using Laravel 5.5 or above, the package will automatically register provider and facade.

#### Laravel 5.4 and below

[](#laravel-54-and-below)

Add `Allanvb\LaravelSemysms\SemySmsServiceProvider` to the `providers` array in your `config/app.php`:

```
'providers' => [
    // Other service providers...

    Allanvb\LaravelSemysms\SemySmsServiceProvider::class,
],
```

Add an alias in your `config/app.php`:

```
'aliases' => [
    ...
    'SemySMS' => Allanvb\LaravelSemysms\Facades\SemySMS::class,
],
```

Or you can `use` the facade class when needed:

```
use Allanvb\Semysms\Facades\SemySMS;
```

Overview
--------

[](#overview)

Look at one of the following topics to learn more about SemySMS package.

- [Configuration](#configuration)
- [Usage](#usage)
- [Examples](#examples)
- [Events](#events)
- [Notification channel](#notification-channel)
- [Exceptions](#exceptions)
- [Extra](#extra)

Configuration
-------------

[](#configuration)

You can use `php artisan vendor:publish` to copy the configuration file to your app's config directory:

```
$ php artisan vendor:publish --provider="Allanvb\LaravelSemysms\SemySmsServiceProvider" --tag="config"
```

Then update `config/semy-sms.php` with your credentials. Also you can update your `.env` file with the following:

```
SEMYSMS_TOKEN=your_access_token
SEMYSMS_DEVICE_ID=default_device_id
```

All methods uses [Validator](https://laravel.com/docs/validation) to validate passed data.

By default, methods will try to use for all requests the device you specified in your `SEMYSMS_DEVICE_ID` variable.

Usage:
------

[](#usage)

To use the SemySMS Library you can access the facade, or request the instance from the service container:

```
SemySMS::sendOne([
    'to' => '+1234567890',
    'text' => 'My first message.'
]);
```

Or

```
app('semy-sms')->sendOne([
    'to' => '+1234567890',
    'text' => 'My first message.'
]);
```

- All numbers must have international format.

All methods and events will return a [Collection](https://laravel.com/docs/collections), so you can use all available methods to manipulate response. For example: `SemySMS::getInbox()->sortByDesc('date');`

Examples
--------

[](#examples)

#### Sending simple message

[](#sending-simple-message)

```
SemySMS::sendOne([
    'to' => '+1234567890',
    'text' => 'Test message'
]);
```

Available parameters:

- `to` - (string) Phone number in international format **(required)**.
- `text` - (string) SMS Text, max 255 symbols **(required)**.
- `device_id` - (string) Device ID or *active*.

`device_id` parameter can also take the `active` value which means that the service will distribute new SMS between all your active devices.

#### Sending multiple messages

[](#sending-multiple-messages)

```
SemySMS::sendMultiple([
    'to' => ['+1234567890','+1567890234','+1902345678'],
    'text' => 'Test message'
]);
```

Available parameters:

- `to` - (array) List of phones in international format **(required)**.
- `text` - (string) SMS Text, max 255 symbols **(required)**.

In case you want to have more control on sending multiple messages you can use chaining methods.

```
$messages = SemySMS::multiple();

$messages->addRecipient([
    'to' => '+1234567890',
    'text' => 'Test message',
]);

$messages->addRecipient([
    'to' => '+1567890234',
    'text' => 'Test message 2',
]);

$messages->send();
```

Available parameters:

- `to` - (string) Phone number in international format **(required)**.
- `text` - (string) SMS Text, max 255 symbols **(required)**.
- `device_id` - (int) Device ID.
- `my_id` - (string) SMS code from your accounting system

#### Sending USSD requests

[](#sending-ussd-requests)

- This feature works only on Android 8.0+

```
SemySMS::ussd([
    'to' => '*123#'
]);
```

You can use `'device_id'` parameter to perform USSD request from specific device.

#### List of outgoing SMS

[](#list-of-outgoing-sms)

```
SemySMS::getOutbox();
```

Optional, you can specify a interval of time you want to get by using `Interval` helper like this.

```
SemySMS::getOutbox([
    'interval' => Interval::days(3)
]);
```

#### List of incoming SMS

[](#list-of-incoming-sms)

```
SemySMS::getInbox();
```

#### Delete outgoing SMS

[](#delete-outgoing-sms)

```
SemySMS::deleteOutbox();
```

#### Delete incoming SMS

[](#delete-incoming-sms)

```
SemySMS::deleteInbox();
```

`deleteOutbox()` and `deleteInbox()` methods will return deleted messages.

Optional, you can use filter for `getOutbox()`, `getInbox()`, `deleteOutbox()` and `deleteInbox()` methods.

Available parameters:

- `interval` - (Interval) Interval of time.
- `device_id` - (int) Device ID.
- `start_id` - (int) Start ID of list filter.
- `end_id` - (int) End ID of list filter.
- `list_id` - (array) List of SMS codes.
- `phone` - (string) Phone number.

#### List of devices

[](#list-of-devices)

```
SemySMS::getDevices();
```

By default this method will return list of all devices connected to account.

Available parameters:

- `status` - (string) active|archived.
- `list_id` - (array) List of devices.

#### Cancel sending SMS

[](#cancel-sending-sms)

```
SemySMS::cancelSMS();
```

This method will cancel all SMS which was not sent to your default device.

You can request canceling of all SMS for specific device by passing `device_id`, or specific message by passing `sms_id` to array.

Events
------

[](#events)

The package have events built in. There are three events available for you to listen for.

EventFiredParametersemy-sms.sentWhen message sent.'To' and 'text' parameters of SMS that was sent.semy-sms.sent-multipleWhen multiple message sent.List of phones, devices and message that was sent.semy-sms.receivedWhen new message income.DeviceID, Sender and Text of income message.semy-sms.ussd-responseWhen ussd response income.DeviceID, Sender and Text of income message.Notification channel
--------------------

[](#notification-channel)

This package also provide notification channel for `SemySMS`.

To use notification channel you must use `SemySmsChannel::class` in `via` method of your notification class. After that you will be able to use `toSemySms()` method for sending messages.

See example below.

```
use Illuminate\Notifications\Notification;
use Allanvb\LaravelSemysms\Channels\SemySmsChannel;
use Allanvb\LaravelSemysms\Channels\SemySmsMessage;

class MyNotification extends Notification
{
    public function via($notifiable)
    {
        return [SemySmsChannel::class];
    }

    public function toSemySms($notifiable)
    {
        return (new SemySmsMessage)
            ->text('My first notification message.');
    }

}
```

You can add recipient in two ways.

- First is by using `routeNotificationForSemySMS()` in your notifiable model as below.

```
// User model

public function routeNotificationForSemySMS()
{
    return $this->phone;
}
```

- Second way is to use `to()` method inside your notification.

```
public function toSemySms($notifiable)
{
    return (new SemySmsMessage)
            ->to('+1234567890')
            ->text('My second notification message.');
}
```

If you'll use both, then `to()` method will be used as primary.

Exceptions
----------

[](#exceptions)

The package can throw the following exceptions:

ExceptionReason*SemySmsValidationException*When method params don't pass validation.*RequestException*When HTTP response will be different than 200.*SmsNotSentException*When something went wrong with the request to SemySMS servers.*InvalidIntervalException*When you pass invalid IntervalExtra
-----

[](#extra)

#### Receiving message from devices

[](#receiving-message-from-devices)

If you want to get incoming messages from your devices, you can use

`https://yourdomain.com/semy-sms/receive` route in your [SemySMS](https://semysms.net) control panel.

To get this route working you need make some actions:

- Change `catch_incoming` to `true` in your config file.
- Add `semy-sms/receive` route to your `$except` variable in `VerifyCsrfToken` middleware.

After that, you will be able to listen for `semy-sms.received` Event.

If you performed an ussd request, you can listen for `semy-sms.ussd-response` Event to process USSD response.

In case that you get USSD response as SMS, you can add sender name to `ussd_senders` in your config file.

You can get more information about Events in [Laravel official documentation](https://laravel.com/docs/events)

#### Intervals

[](#intervals)

Interval class offers the following methods: `hours()`, `days()`, `weeks()`, `months()` and `years()`.

If you want to have more control on `Interval` you can pass a `startDate` and an `endDate` to the object.

```
$startDate = Carbon::yesterday()->subDays(1);
$endDate = Carbon::yesterday();

Interval::create($startDate, $endDate);
```

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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 ~63 days

Recently: every ~142 days

Total

10

Last Release

1855d ago

PHP version history (2 changes)1.0.1PHP &gt;=5.6.4

1.0.9PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ebd148e67fc89e01df6c727b65db92ddf77fa3a14f8963e830ce5fb96a76b88?d=identicon)[alanvb](/maintainers/alanvb)

---

Top Contributors

[![allanvb](https://avatars.githubusercontent.com/u/53047487?v=4)](https://github.com/allanvb "allanvb (31 commits)")

---

Tags

laravellaravel-packagelaravel-smslibrarysemysmssmssms-clisms-gatewaytelephonylaravelsemysms

### Embed Badge

![Health badge](/badges/allanvb-laravel-semysms/health.svg)

```
[![Health](https://phpackages.com/badges/allanvb-laravel-semysms/health.svg)](https://phpackages.com/packages/allanvb-laravel-semysms)
```

###  Alternatives

[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[tpetry/laravel-mysql-explain

Get Visual MySQL EXPLAIN for Laravel.

264154.2k](/packages/tpetry-laravel-mysql-explain)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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