PHPackages                             itpalert/web2sms-notification-channel - 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. itpalert/web2sms-notification-channel

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

itpalert/web2sms-notification-channel
=====================================

Web2sms Notification Channel for Laravel with full PHP 8.2+ type safety.

2.0.0(4mo ago)057MITPHPPHP ^8.2CI passing

Since Jan 29Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/itpalert/web2sms-notification-channel)[ Packagist](https://packagist.org/packages/itpalert/web2sms-notification-channel)[ RSS](/packages/itpalert-web2sms-notification-channel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (7)Used By (0)

Web2sms notifications channel for Laravel
=========================================

[](#web2sms-notifications-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f1ed954b3dc5e0e7e9355b7523e9e63ea8287b03b394cd632879d3c7cbcf6d68/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f697470616c6572742f77656232736d732d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/itpalert/web2sms-notification-channel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d5b4cce9a3284e7f33ed237c5e5314787a0703a7844668f66a405999880757fa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f697470616c6572742f77656232736d732d6e6f74696669636174696f6e2d6368616e6e656c2f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/itpalert/web2sms-notification-channel/actions?query=workflow%3Atests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f400052fb042261d051233be291ce72dc3754cc7571cbe251a3fcf11fb39fb81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f697470616c6572742f77656232736d732d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/itpalert/web2sms-notification-channel)

This package makes it easy to send notifications using [Web2sms](https://www.web2sms.ro/) with Laravel 8.0+.

Features
--------

[](#features)

✅ Full PHP 8.0+ type safety
✅ Supports Laravel 8.x through 12.x
✅ SMS scheduling
✅ Unicode message support
✅ Status callbacks
✅ Custom sender IDs
✅ Client reference tracking
✅ 30+ comprehensive tests

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Available Message Methods](#available-message-methods)
- [Testing](#testing)
- [Changelog](#changelog)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require itpalert/web2sms-notification-channel
```

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

[](#configuration)

### Setting up the Web2sms service

[](#setting-up-the-web2sms-service)

Add the following environment variables to your `.env`:

```
WEB2SMS_KEY=8c78axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WEB2SMS_SECRET=e9a689cfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WEB2SMS_SMS_FROM=ALERT
WEB2SMS_ACCOUNT_TYPE=prepaid
```

Add the following to your `config/services.php`:

```
'web2sms' => [
    'key' => env('WEB2SMS_KEY'),
    'secret' => env('WEB2SMS_SECRET'),
    'sms_from' => env('WEB2SMS_SMS_FROM', ''),
    'account_type' => env('WEB2SMS_ACCOUNT_TYPE', 'prepaid'),
],
```

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
use ITPalert\Web2smsChannel\Messages\Web2smsMessage;
use Illuminate\Notifications\Notification;

class ProjectCreated extends Notification
{
    public function via($notifiable)
    {
        return ['web2sms'];
    }

    public function toWeb2sms($notifiable)
    {
        return new Web2smsMessage('Your project has been created!');
    }
}
```

### Routing notifications

[](#routing-notifications)

Add the `routeNotificationForWeb2sms` method to your Notifiable model to specify which phone number to use:

```
public function routeNotificationForWeb2sms(Notification $notification): string
{
    return $this->phone_number;
}
```

### Simple string message

[](#simple-string-message)

```
public function toWeb2sms($notifiable): string
{
    return 'Simple SMS message';
}
```

Available Message Methods
-------------------------

[](#available-message-methods)

### Basic Methods

[](#basic-methods)

```
public function toWeb2sms($notifiable): Web2smsMessage
{
    return (new Web2smsMessage())
        ->content('Your message content here')
        ->from('SENDER_ID');
}
```

### Unicode Support

[](#unicode-support)

For messages containing special characters (Romanian diacritics, emojis, etc.):

```
public function toWeb2sms($notifiable): Web2smsMessage
{
    return (new Web2smsMessage('Mesaj cu diacritice: ăîâșț'))
        ->unicode();
}
```

### Client Reference

[](#client-reference)

Track messages with a unique reference (max 40 characters):

```
public function toWeb2sms($notifiable): Web2smsMessage
{
    return (new Web2smsMessage('Your message'))
        ->clientReference('order-' . $this->order->id);
}
```

### Status Callbacks

[](#status-callbacks)

Get notified when message status changes:

```
public function toWeb2sms($notifiable): Web2smsMessage
{
    return (new Web2smsMessage('Your message'))
        ->statusCallback(route('sms.status', $this->id));
}
```

### Scheduled Messages

[](#scheduled-messages)

Send messages at a specific time:

```
public function toWeb2sms($notifiable): Web2smsMessage
{
    return (new Web2smsMessage('Reminder message'))
        ->schedule('2024-12-25 10:00:00');
}
```

### Displayed Message

[](#displayed-message)

Hide actual message content in dashboard (useful for sensitive data):

```
public function toWeb2sms($notifiable): Web2smsMessage
{
    return (new Web2smsMessage('Your OTP is: 123456'))
        ->displayedMessage('OTP sent to customer');
}
```

### Custom Client

[](#custom-client)

Use a different Web2sms client for specific notifications:

```
public function toWeb2sms($notifiable): Web2smsMessage
{
    $customClient = new \ITPalert\Web2sms\Client(
        'different-key',
        'different-secret'
    );

    return (new Web2smsMessage('Your message'))
        ->usingClient($customClient);
}
```

### Complete Example

[](#complete-example)

```
public function toWeb2sms($notifiable): Web2smsMessage
{
    return (new Web2smsMessage())
        ->content('Comanda #' . $this->order->id . ' a fost confirmată!')
        ->from('MAGAZIN')
        ->unicode()
        ->clientReference('order-' . $this->order->id)
        ->statusCallback(route('sms.status', $this->order->id))
        ->displayedMessage('Order confirmation sent');
}
```

Testing
-------

[](#testing)

Run the tests with:

```
composer test
```

Run tests with coverage:

```
composer test-coverage
```

Run static analysis:

```
composer analyse
```

Check code style:

```
composer check-style
```

Fix code style:

```
composer format
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Gere Attila](https://github.com/itpalert)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Recently: every ~126 days

Total

6

Last Release

139d ago

Major Versions

1.2.3 → 2.0.02025-12-21

PHP version history (2 changes)1.0.0PHP ^8.0

2.0.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![itpalert](https://avatars.githubusercontent.com/u/37656719?v=4)](https://github.com/itpalert "itpalert (23 commits)")

---

Tags

laravelnotificationssmsRomaniaweb2sms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/itpalert-web2sms-notification-channel/health.svg)

```
[![Health](https://phpackages.com/badges/itpalert-web2sms-notification-channel/health.svg)](https://phpackages.com/packages/itpalert-web2sms-notification-channel)
```

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[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)
