PHPackages                             lbhurtado/missive - 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. lbhurtado/missive

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

lbhurtado/missive
=================

Add SMS domain to a Laravel project - route, models, migrations, jobs, notifications, etc.

v2.3.0(4y ago)0620↓80%MITPHPPHP ^7.2||^8.0.1CI failing

Since May 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lbhurtado/missive)[ Packagist](https://packagist.org/packages/lbhurtado/missive)[ Docs](https://github.com/lbhurtado/missive)[ RSS](/packages/lbhurtado-missive/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (11)Versions (29)Used By (0)

Missive
=======

[](#missive)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f197c4c60ba0e45b7b83fa3be27dce958c9c6168d95ae933647b60a3ba698eb5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c626875727461646f2f6d6973736976652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lbhurtado/missive)[![Build Status](https://camo.githubusercontent.com/81e82520073d36e5039adf5ac53bee96d6aa14a20f1fdc19ebb695fb25dcdbca/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c626875727461646f2f6d6973736976652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/lbhurtado/missive)[![Quality Score](https://camo.githubusercontent.com/7f711680f10b06d8c9074fec083939648b52e3718e781f76db42faec18efca84/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c626875727461646f2f6d6973736976652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/lbhurtado/missive)[![Total Downloads](https://camo.githubusercontent.com/04922776a3ff629fcf0c2114517cdd584cc11df8c72080e99073656768099733/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c626875727461646f2f6d6973736976652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lbhurtado/missive)

Add SMS domain to a Laravel project - route, models, migrations, events, jobs, actions, etc.

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

[](#installation)

You can install the package via composer:

```
composer require lbhurtado/missive
```

publish vendor files:

```
php artisan vendor:publish --provider="LBHurtado\Missive\MissiveServiceProvider"
php artisan notifications:table
php artisan migrate

```

optionally, if you want sms charging:

```
composer dumpautoload
php artisan db:seed --class=AirtimeSeeder
```

then uncomment the middleware in missive.php

inherit models:

```
namespace App;

use LBHurtado\EngageSpark\Traits\HasEngageSpark;
use LBHurtado\Missive\Models\Contact as BaseContact;

class Contact extends BaseContact
{
    use HasEngageSpark;
}
```

customize the tables and classes e.g. App\\Contact:

```
[
	'table_names' => [
		'smss'     => 's_m_s_s',
		'contacts' => 'contacts',
		'relays'   => 'relays',
        'topups'   => 'topups',
	],
    'classes' => [
            'models' => [
                'airtime' => \LBHurtado\Missive\Models\Airtime::class,
                'contact' => \App\Contact::class,
                'relay' => \LBHurtado\Missive\Models\Relay::class,
                'sms' => \LBHurtado\Missive\Models\SMS::class
            ],
            'commands' => [
                'sms' => [
                    'create' => \LBHurtado\Missive\Commands\CreateSMSCommand::class
                ]
            ],
            'handlers' => [
                'sms' => [
                    'create' => \LBHurtado\Missive\Handlers\CreateSMSHandler::class
                ]
            ],
            'middlewares' => [
                'sms' => [
                    'relay' => [
                        \LBHurtado\Missive\Validators\CreateSMSValidator::class,
                        \LBHurtado\Missive\Responders\CreateSMSResponder::class,
    //                \LBHurtado\Missive\Actions\Middleware\ChargeSMSMiddleware::class,
                    ],
                    'verify' => [
                        \LBHurtado\Missive\Validators\CreateSMSValidator::class,
                        \LBHurtado\Missive\Responders\CreateSMSResponder::class,
                        \LBHurtado\Missive\Actions\Middleware\VerifyContactHandler::class,
    //                    \LBHurtado\Missive\Actions\Middleware\ChargeSMSMiddleware::class,
                    ],
                    'topup' => [
                        \LBHurtado\Missive\Validators\CreateSMSValidator::class,
                        \LBHurtado\Missive\Responders\CreateSMSResponder::class,
                        \LBHurtado\Missive\Actions\Middleware\TopupMobileHandler::class,
    //                    \LBHurtado\Missive\Actions\Middleware\ChargeSMSMiddleware::class,
                    ],
                ],
            ]
        ]
]
```

customize the routes in routes/sms.php:

```
use LBHurtado\EngageSpark\Notifications\Adhoc;

$router = resolve('missive:router');

$router->register('LOG {message}', function (string $path, array $values) use ($router) {
    \Log::info($values['message']);

    tap($router->missive->getSMS()->origin, function ($contact) use ($values) {
        $message = $values['message'];
        $contact->notify(new Adhoc("{$contact->mobile}: $message"));
    });
});
```

Usage
-----

[](#usage)

```
use LBHurtado\Missive\Models\SMS;
use LBHurtado\Missive\Jobs\CreateSMS;
use LBHurtado\Missive\Repositories\SMSRepository;

CreateSMS::dispatch($attributes);
$sms = SMS::first();

$smss = app(SMSRepository::class);
$sms = $smss->first();
```

```
use LBHurtado\Missive\Models\Contact;
use LBHurtado\Missive\Jobs\CreateContact;
use LBHurtado\Missive\Repositories\ContactRepository;

CreateContact::dispatch($mobile);
$contact = Contact::first();

$contacts = app(ContactRepository::class);
$contact = $contacts->first();

```

```
use LBHurtado\Missive\Models\Relay;
use LBHurtado\Missive\Jobs\CreateRelay;
use LBHurtado\Missive\Repositories\RelayRepository;

CreateRelay::dispatch($mobile);
$relay = Relay::first();

$relays = app(RelayRepository::class);
$relay = $relays->first();
```

add otp verification to your contacts:

```
use LBHurtado\Missive\Traits\HasOTP;
use LBHurtado\Missive\Models\Contact;

$contact = Contact::find(1);
$otp = $contact->challenge()->now();
//default period for OTP is 360 seconds
//modify it in .env i.e. DEFAULT_OTP_PERIOD=1000

if ($contact->verify($otp) == true) {
    //code here
}
```

sms relay

```
curl -X POST \
  http://laravel.app/api/sms/relay \
  -H 'Accept: */*' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: laravel.app' \
  -d '{
    "secret": "CFAWG4KCE44XWACTZZX24Z7LPW99XTWT",
    "from": "+639171234567",
    "to": "+639187654321",
    "message": "LOG test message"
}'
```

sms OTP verification

```
curl -X POST \
  http://laravel.app/api/sms/verify \
  -H 'Accept: */*' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: laravel.app' \
  -d '{
    "secret": "CFAWG4KCE44XWACTZZX24Z7LPW99XTWT",
    "from": "+639171234567",
    "to": "+639187654321",
    "message": "123456"
}'
```

sms topup

```
curl -X POST \
  http://laravel.app/api/sms/topup \
  -H 'Accept: */*' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: laravel.app' \
  -d '{
    "secret": "CFAWG4KCE44XWACTZZX24Z7LPW99XTWT",
    "from": "+639171234567",
    "to": "+639187654321",
    "message": "09171234567 25"
}'
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Lester Hurtado](https://github.com/lbhurtado)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 98.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 ~39 days

Recently: every ~127 days

Total

28

Last Release

1490d ago

Major Versions

1.7.0 → 2.0.02020-11-22

PHP version history (3 changes)1.0.0PHP ^7.1

1.3.1PHP ^7.2

v2.2.0PHP ^7.2||^8.0.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd9f88a96abae072ebe0b8b784a131cd7d409c987d7fca9b51a6670612243018?d=identicon)[lbhurtado](/maintainers/lbhurtado)

---

Top Contributors

[![lbhurtado](https://avatars.githubusercontent.com/u/5870664?v=4)](https://github.com/lbhurtado "lbhurtado (148 commits)")[![3neti](https://avatars.githubusercontent.com/u/89447696?v=4)](https://github.com/3neti "3neti (2 commits)")

---

Tags

smscontactslbhurtadomissive

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lbhurtado-missive/health.svg)

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

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[tzsk/sms

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

320244.3k6](/packages/tzsk-sms)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)[nutnet/laravel-sms

Package for sending SMS form your Laravel app, includes pre-installed sms providers and your custom.

2526.6k](/packages/nutnet-laravel-sms)[ghanem/laravel-smsmisr

Send SMS and SMS Notification via SMS Misr for Laravel

194.8k](/packages/ghanem-laravel-smsmisr)

PHPackages © 2026

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