PHPackages                             kpaph/msg4wrdio - 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. [API Development](/categories/api)
4. /
5. kpaph/msg4wrdio

ActiveLibrary[API Development](/categories/api)

kpaph/msg4wrdio
===============

SMS Gateway API

v2026.1.1(1mo ago)160MITPHPPHP ^8.1

Since Apr 18Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/KPA-PH/kpaph-msg4wrd)[ Packagist](https://packagist.org/packages/kpaph/msg4wrdio)[ RSS](/packages/kpaph-msg4wrdio/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

About MSG4wrd
-------------

[](#about-msg4wrd)

MSG4wrd is an SMS Gateway and Message Forwarder API formerly known as PTXT4wrd.

From 2005 to 2012, in the Philippines, some networks only allowed text messaging within the same network. Promos were available for unlimited texting to the same network, such as SMART to SMART or GLOBE to GLOBE only.

To address this issue, PTXT4wrd was invented, which allows users to send messages to other networks by forwarding their texts from their own network.

Example command for sending a message to other networks:

> PTXT{space}OtherNetworkNumber{space}YourMessage then send to Gateway.

> PTXT 09171234567 Hello world! Then, send to gateway number.

Gateways - SMART / GLOBE / SUN If you are smart, you will use SMART Gateway, identical to the other networks.

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

[](#requirements)

- PHP `^8.1`
- Laravel `8.x` – `12.x`

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

[](#installation)

> composer require kpaph/msg4wrdio

The service provider is auto-discovered by Laravel — no manual registration in `config/app.php` is required.

Publish the config file (`config/msg4wrdio.php`):

> php artisan vendor:publish --tag=msg4wrdio-config

Add your token to `.env`. Get a token at [MSG4wrd.io](https://www.msg4wrd.io/):

```
MSG4wrdIO_TOKEN=YOUR-TOKEN-HERE

```

### Demo routes (optional, disabled by default)

[](#demo-routes-optional-disabled-by-default)

The package ships with demo routes (`/msg4wrd`, `/msg4wrd/send`, `/msg4wrd/send-with-options`) for smoke-testing. They are **unauthenticated** and can trigger SMS sends billed to your token, so they are disabled by default. To enable them in local environments only:

```
MSG4wrdIO_EXPOSE_DEMO_ROUTES=true

```

With the demo routes enabled you can check the install:

>

And trigger a test send:

>

Note: Only `+63` (Philippines mobile) and `+1` (US / Canada) numbers are accepted. A leading `+` and common separators (spaces, dashes, dots, parentheses) are stripped automatically. Examples of valid input: `+63 917 123 4567`, `639171234567`, `+1 (202) 664-5435`, `12026645435`.

Usage
-----

[](#usage)

Create a controller, e.g. `SMSController`:

```
