PHPackages                             husam-tariq/filamentsmssender - 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. husam-tariq/filamentsmssender

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

husam-tariq/filamentsmssender
=============================

A powerful FilamentPHP v3 plugin designed to simplify sending SMS messages and implementing One-Time Password (OTP) verification within your Laravel applications. This plugin provides a flexible custom HTTP request builder, allowing seamless integration with virtually any SMS gateway API without writing custom code for each provider.

v1.0.2(10mo ago)11[3 PRs](https://github.com/husam-tariq/FilamentSmsSender/pulls)MITPHPPHP ^8.1CI passing

Since Jun 20Pushed 1mo agoCompare

[ Source](https://github.com/husam-tariq/FilamentSmsSender)[ Packagist](https://packagist.org/packages/husam-tariq/filamentsmssender)[ Docs](https://github.com/husam-tariq/filamentsmssender)[ GitHub Sponsors](https://github.com/husam-tariq)[ RSS](/packages/husam-tariq-filamentsmssender/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (10)Versions (7)Used By (0)

FilamentPHP SMS Sender Plugin
=============================

[](#filamentphp-sms-sender-plugin)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cbbe3306542e2c5143134225f5b689853434977dfbd73d479d373a4c8b73ad23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f687573616d2d74617269712f66696c616d656e74736d7373656e6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/husam-tariq/filamentsmssender)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c54750eb2c482a85b38a97a28c58cb26492304fc68ed5e64becc6108a60ed801/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f687573616d2d74617269712f66696c616d656e74736d7373656e6465722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/husam-tariq/filamentsmssender/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ca4316d8244c4f7e35b4d6e637e9fb4d569dcb52ea1b7cce48f5bc20f7de065f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f687573616d2d74617269712f66696c616d656e74736d7373656e6465722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/husam-tariq/filamentsmssender/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/81039ce43dfbdfa0fb776f046079b7771664b003c867c1a388fe1f92f0c2361d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f687573616d2d74617269712f66696c616d656e74736d7373656e6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/husam-tariq/filamentsmssender)

A powerful FilamentPHP v3 plugin for sending SMS messages and implementing One-Time Password (OTP) verification in your Laravel applications. This plugin provides a flexible custom HTTP request builder that allows seamless integration with virtually any SMS gateway API without writing custom code for each provider.

Features
--------

[](#features)

🚀 **Custom HTTP Request Builder** - Configure any SMS API without code 📱 **OTP Verification System** - Complete OTP generation, sending, and verification ⚙️ **Filament Admin Interface** - Manage SMS providers and test gateways in real-time 🔒 **Rate Limiting** - Built-in protection against OTP abuse 🎯 **Multiple Identifiers** - Support for different OTP contexts (registration, password reset, etc.) 📊 **Comprehensive Logging** - Detailed logs for debugging and monitoring 🧪 **Testing Tools** - Artisan commands and admin panel testing features 🎨 **Livewire Components** - Ready-to-use OTP verification components

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

[](#installation)

Install the package via composer:

```
composer require husam-tariq/filamentsmssender
```

Publish and run the migrations:

```
php artisan vendor:publish --tag="filamentsmssender-migrations"
php artisan migrate
```

Optionally, publish the config file:

```
php artisan vendor:publish --tag="filamentsmssender-config"
```

Plugin Registration
-------------------

[](#plugin-registration)

Register the plugin in your Filament panel provider:

```
use HusamTariq\FilamentSmsSender\FilamentSmsSenderPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentSmsSenderPlugin::make(),
        ]);
}
```

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

[](#configuration)

### Admin Panel Configuration

[](#admin-panel-configuration)

1. Navigate to **SMS Providers** in your Filament admin panel
2. Add and configure your SMS providers:
    - **Gateway Settings**: Set API endpoint, method, parameters, and headers
    - **OTP Settings**: Configure OTP length, expiry, and rate limiting

### Example Configuration

[](#example-configuration)

Here's an example configuration for a typical SMS API:

**Request Parameters:**

```
Key: api_key, Value: your-api-key-here
Key: to, Value: {{ recipient }}
Key: message, Value: {{ message }}
Key: from, Value: YourAppName

```

**Request Headers:**

```
Key: Authorization, Value: Bearer your-token-here
Key: Content-Type, Value: application/x-www-form-urlencoded

```

Usage
-----

[](#usage)

### Basic SMS Sending

[](#basic-sms-sending)

```
use HusamTariq\FilamentSmsSender\Facades\FilamentSmsSender;
use HusamTariq\FilamentSmsSender\Services\SmsService;

// Using the facade
$success = FilamentSmsSender::send('+1234567890', 'Hello, World!');

// Using the service directly
$smsService = app(SmsService::class);
$success = $smsService->send('+1234567890', 'Hello, World!');
```

### OTP Functionality

[](#otp-functionality)

#### Sending an OTP

[](#sending-an-otp)

```
use HusamTariq\FilamentSmsSender\Services\SmsService;

$smsService = app(SmsService::class);

// Send OTP for user registration
$otpCode = $smsService->sendOtp('+1234567890', 'user_registration');

if ($otpCode) {
    // OTP sent successfully
    // Store the phone number in session for verification
    session(['pending_verification_phone' => '+1234567890']);
} else {
    // Failed to send OTP (rate limited or configuration error)
}
```

#### Verifying an OTP

[](#verifying-an-otp)

```
$isValid = $smsService->verifyOtp(
    '+1234567890',          // recipient
    '123456',               // OTP code
    'user_registration'     // identifier (optional)
);

if ($isValid) {
    // OTP is valid and has been marked as used
    // Complete the user registration process
} else {
    // OTP is invalid, expired, or already used
}
```

### Using the Livewire Component

[](#using-the-livewire-component)

Include the OTP verification component in your Blade views:

```
@livewire('otp-verification')
```

You can listen for the `otp-verified` event:

```
document.addEventListener('livewire:load', function () {
    Livewire.on('otp-verified', (data) => {
        console.log('OTP verified for:', data.recipient);
        // Handle successful verification
    });
});
```

Artisan Commands
----------------

[](#artisan-commands)

The plugin provides several Artisan commands for testing and management:

### Send SMS

[](#send-sms)

```
# Send a test SMS
php artisan sms:send "+1234567890" "Test message"

# Send in test mode
php artisan sms:send "+1234567890" "Test message" --test
```

### Send OTP

[](#send-otp)

```
# Send an OTP
php artisan sms:send-otp "+1234567890"

# Send OTP with identifier
php artisan sms:send-otp "+1234567890" --identifier="test"
```

### Verify OTP

[](#verify-otp)

```
# Verify an OTP
php artisan sms:verify-otp "+1234567890" "123456"

# Verify OTP with identifier
php artisan sms:verify-otp "+1234567890" "123456" --identifier="test"
```

SMS Gateway Integration Examples
--------------------------------

[](#sms-gateway-integration-examples)

### Twilio

[](#twilio)

```
Method: POST
Endpoint: https://api.twilio.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Messages.json

Parameters:
- From: +1234567890
- To: {{ recipient }}
- Body: {{ message }}

Headers:
- Authorization: Basic [base64_encoded_credentials]

```

### Nexmo/Vonage

[](#nexmovonage)

```
Method: POST
Endpoint: https://rest.nexmo.com/sms/json

Parameters:
- api_key: your_api_key
- api_secret: your_api_secret
- from: YourApp
- to: {{ recipient }}
- text: {{ message }}

```

### AWS SNS

[](#aws-sns)

```
Method: POST
Endpoint: https://sns.region.amazonaws.com/

Parameters:
- Action: Publish
- PhoneNumber: {{ recipient }}
- Message: {{ message }}

Headers:
- Authorization: AWS4-HMAC-SHA256 Credential=...
- Content-Type: application/x-www-form-urlencoded

```

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

[](#installation-1)

You can install the package via composer:

```
composer require husam-tariq/filamentsmssender
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="filamentsmssender-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="filamentsmssender-config"
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="filamentsmssender-views"
```

This is the contents of the published config file:

```
return [
];
```

Usage
-----

[](#usage-1)

```
$filamentSmsSender = new HusamTariq\FilamentSmsSender();
echo $filamentSmsSender->echoPhrase('Hello, HusamTariq!');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

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

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [Hussam Tariq](https://github.com/husam-tariq)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance74

Regular maintenance activity

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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 ~0 days

Total

2

Last Release

326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4dc8077d57465f576cd8bdff46da69d2a5637f52972c9c2cd3c13e9f97144a4d?d=identicon)[husam-tariq](/maintainers/husam-tariq)

---

Top Contributors

[![husam-tariq](https://avatars.githubusercontent.com/u/16601695?v=4)](https://github.com/husam-tariq "husam-tariq (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelhusam-tariqfilamentsmssender

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/husam-tariq-filamentsmssender/health.svg)

```
[![Health](https://phpackages.com/badges/husam-tariq-filamentsmssender/health.svg)](https://phpackages.com/packages/husam-tariq-filamentsmssender)
```

###  Alternatives

[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[spatie/laravel-mailcoach-sdk

An SDK to easily work with the Mailcoach API in Laravel apps

41290.2k1](/packages/spatie-laravel-mailcoach-sdk)[tzsk/sms

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

320244.3k6](/packages/tzsk-sms)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

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