PHPackages                             devwizardhq/laravel-textify - 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. devwizardhq/laravel-textify

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

devwizardhq/laravel-textify
===========================

🚀 Enterprise-ready Laravel SMS package supporting 8+ providers including Bangladeshi (DhorolaSMS, BulkSMSBD, MimSMS, eSMS, REVE SMS, Alpha SMS) &amp; international gateways (Twilio, Nexmo). Features automatic fallback, queue integration, activity tracking, balance checking, and fluent API for production-grade SMS solutions.

v1.5.1(2mo ago)6157[1 PRs](https://github.com/DevWizardHQ/laravel-textify/pulls)MITPHPPHP ^8.3CI passing

Since Aug 3Pushed 2mo agoCompare

[ Source](https://github.com/DevWizardHQ/laravel-textify)[ Packagist](https://packagist.org/packages/devwizardhq/laravel-textify)[ Docs](https://github.com/devwizardhq/laravel-textify)[ GitHub Sponsors](https://github.com/DevWizard)[ RSS](/packages/devwizardhq-laravel-textify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (32)Versions (15)Used By (0)

Laravel Textify 📱
=================

[](#laravel-textify-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9e4952fa360b61134acab902baa232626c953254185c31a7bf8db101c8a0181a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64657677697a61726468712f6c61726176656c2d746578746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devwizardhq/laravel-textify)[![GitHub Tests Action Status](https://camo.githubusercontent.com/5b58543c89fda5af3e1bf56ad8bda0de948e248a46f014e049d60447b0c742f8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64657677697a61726468712f6c61726176656c2d746578746966792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/devwizardhq/laravel-textify/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/dc08d1ab3863c03b4aa9927314325384ae6e86cccdc9170d02fdc264490c6443/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64657677697a61726468712f6c61726176656c2d746578746966792f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/devwizardhq/laravel-textify/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d3078e1701023546a77de82da8815f5639827dfa691c02b5362cf2b7fa0dd95c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64657677697a61726468712f6c61726176656c2d746578746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devwizardhq/laravel-textify)[![License](https://camo.githubusercontent.com/1bcbd5c811b35a73c9df14ffc4e0df2be0b8dab6a3bc8016234e489dc67eb53c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64657677697a61726468712f6c61726176656c2d746578746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devwizardhq/laravel-textify)

A powerful and enterprise-ready SMS package for Laravel applications supporting **8+ SMS providers** including Bangladeshi and international gateways. Built with modern PHP 8.3+ and Laravel 10+ support, featuring queue integration, automatic fallback system, comprehensive activity tracking, and an intuitive fluent API.

**Perfect for Laravel developers who need reliable SMS functionality with multiple provider support and enterprise-grade features.**

✨ Features
----------

[](#-features)

- 🚀 **Multiple SMS Providers**: Support for 8+ SMS gateways with unified API
- 🇧🇩 **Bangladeshi SMS Providers**: DhorolaSMS, BulkSMSBD, MimSMS, eSMS, REVE SMS, Alpha SMS
- 🌍 **International SMS Providers**: Twilio, Nexmo (Vonage) with optional SDK installation
- 🔄 **Automatic Fallback System**: Seamless failover between providers for maximum reliability
- 📊 **Comprehensive Activity Tracking**: Database and file-based logging with audit trails
- ⚡ **Laravel Queue Integration**: Background SMS processing for improved performance
- 🔔 **Laravel Notifications**: Native notification channel support with `toTextify()` method
- 🎯 **Fluent API**: Intuitive and chainable methods for developer-friendly experience
- 📱 **Smart Phone Number Validation**: Automatic formatting and validation for multiple countries
- 🎨 **Event-Driven Architecture**: Listen to SMS lifecycle events (sending, sent, failed)
- ⚙️ **Highly Configurable**: Flexible configuration with environment variable support
- 🛡️ **Production Ready**: Built with enterprise-grade error handling and logging
- 🔧 **Extensible**: Easy custom provider integration

� Table of Contents
-------------------

[](#-table-of-contents)

- [📡 Supported SMS Providers](#-supported-sms-providers)
- [📦 Installation](#-installation)
- [Configuration](#configuration)
- [🚀 Quick Start](#-quick-start)
- [🔔 Laravel Notifications](#-laravel-notifications)
- [📋 Provider-Specific Usage](#-provider-specific-usage)
- [📚 API Reference](#-api-reference)
- [🔧 Advanced Usage](#-advanced-usage)
- [Testing](#testing)
- [Contributing](#contributing)

�📡 Supported SMS Providers
--------------------------

[](#-supported-sms-providers)

### 🇧🇩 Bangladeshi Providers

[](#-bangladeshi-providers)

ProviderFeaturesStatusMethods**DhorolaSMS**GET API, Status tracking, SSL support✅ Ready`send()`, `getBalance()`**BulkSMSBD**GET/POST API, Bulk sending, Plain text response✅ Ready`send()`, `getBalance()`**MimSMS**Transactional/Promotional, Campaign support✅ Ready`send()`, `getBalance()`**eSMS**Enterprise API, Bearer token auth, Cost tracking✅ Ready`send()`**REVE SMS**Premium gateway, Balance check, Multi-endpoint✅ Ready`send()`, `getBalance()`**Alpha SMS**Dual format support, Balance check, SSL/Non-SSL✅ Ready`send()`, `getBalance()`### 🌍 International Providers

[](#-international-providers)

ProviderFeaturesStatusInstallationMethods**Twilio**Global leader, Advanced features, Webhooks✅ Ready`composer require twilio/sdk``send()`, Advanced APIs**Nexmo (Vonage)**International coverage, Client tracking✅ Ready`composer require vonage/client``send()`, Analytics### 🛠️ Development &amp; Testing Providers

[](#️-development--testing-providers)

ProviderPurposeFeatures**Log Provider**Development testingLogs SMS to Laravel logs**Array Provider**Unit testingStores SMS in memory array> **Note**: International providers require additional SDK installation for full functionality. Development providers are included for testing purposes.

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require devwizardhq/laravel-textify
```

### 🔧 Laravel Auto-Discovery

[](#-laravel-auto-discovery)

Laravel will automatically register the service provider and facade. No additional configuration required!

### 📄 Publish Configuration

[](#-publish-configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="DevWizard\Textify\TextifyServiceProvider" --tag="textify-config"
```

### 🗄️ Optional: Database Activity Tracking

[](#️-optional-database-activity-tracking)

If you want to track SMS activities in your database:

```
php artisan textify:table
php artisan migrate
```

### 📋 Requirements

[](#-requirements)

- **PHP**: 8.3 or higher
- **Laravel**: 10.0, 11.0, or 12.0
- **Extensions**: cURL, JSON

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

[](#configuration)

### Timeout Configuration

[](#timeout-configuration)

Laravel Textify supports two types of timeout configurations for all SMS providers:

- **`timeout`**: Maximum time (in seconds) to wait for a response from the API (default: 30s)
- **`connect_timeout`**: Maximum time (in seconds) to wait for connection establishment (default: 10s)

These settings help ensure reliable SMS delivery by preventing indefinite waits when providers are slow or unreachable.

### Environment Variables

[](#environment-variables)

Add these to your `.env` file based on the providers you want to use:

```
# Primary Provider Selection
TEXTIFY_PROVIDER=mimsms
TEXTIFY_FALLBACK_PROVIDER=revesms

# ===== BANGLADESHI PROVIDERS =====

# DhorolaSMS Configuration
DHOROLA_API_KEY=your_api_key
DHOROLA_SENDER_ID=your_sender_id
DHOROLA_BASE_URI=https://api.dhorolasms.net
DHOROLA_TIMEOUT=30
DHOROLA_CONNECT_TIMEOUT=10
DHOROLA_VERIFY_SSL=true

# BulkSMSBD Configuration
BULKSMSBD_API_KEY=your_api_key
BULKSMSBD_SENDER_ID=your_sender_id
BULKSMSBD_BASE_URI=http://bulksmsbd.net
BULKSMSBD_TIMEOUT=30
BULKSMSBD_CONNECT_TIMEOUT=10
BULKSMSBD_VERIFY_SSL=false

# MimSMS Configuration
MIMSMS_USERNAME=your_username
MIMSMS_APIKEY=your_api_key
MIMSMS_SENDER_ID=your_sender_id
MIMSMS_TRANSACTION_TYPE=T
MIMSMS_CAMPAIGN_ID=your_campaign_id
MIMSMS_BASE_URI=https://api.mimsms.com
MIMSMS_TIMEOUT=30
MIMSMS_CONNECT_TIMEOUT=10
MIMSMS_VERIFY_SSL=true

# eSMS Configuration
ESMS_API_TOKEN=your_api_token
ESMS_SENDER_ID=your_sender_id
ESMS_BASE_URI=https://login.esms.com.bd
ESMS_TIMEOUT=30
ESMS_CONNECT_TIMEOUT=10
ESMS_VERIFY_SSL=true

# REVE SMS Configuration
REVESMS_APIKEY=your_api_key
REVESMS_SECRETKEY=your_secret_key
REVESMS_CLIENT_ID=your_client_id
REVESMS_SENDER_ID=your_sender_id
REVESMS_BASE_URI=https://smpp.revesms.com:7790
REVESMS_BALANCE_URI=https://smpp.revesms.com
REVESMS_TIMEOUT=30
REVESMS_CONNECT_TIMEOUT=10
REVESMS_VERIFY_SSL=true

# Alpha SMS Configuration
ALPHASMS_API_KEY=your_api_key
ALPHASMS_SENDER_ID=your_sender_id
ALPHASMS_BASE_URI=https://api.sms.net.bd
ALPHASMS_TIMEOUT=30
ALPHASMS_CONNECT_TIMEOUT=10
ALPHASMS_VERIFY_SSL=true

# ===== INTERNATIONAL PROVIDERS =====

# Twilio Configuration
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_FROM=your_phone_number

# Nexmo (Vonage) Configuration
NEXMO_API_KEY=your_api_key
NEXMO_API_SECRET=your_api_secret
NEXMO_FROM=your_sender_id
NEXMO_CLIENT_REF=your_reference
NEXMO_TIMEOUT=30
NEXMO_CONNECT_TIMEOUT=10
NEXMO_VERIFY_SSL=true

# ===== PACKAGE CONFIGURATION =====

# Activity Tracking
TEXTIFY_ACTIVITY_TRACKING_ENABLED=true
TEXTIFY_ACTIVITY_DRIVER=database

# Logging Configuration
TEXTIFY_LOGGING_ENABLED=true
TEXTIFY_LOG_SUCCESSFUL=true
TEXTIFY_LOG_FAILED=true
TEXTIFY_LOG_CHANNEL=stack

# Queue Configuration
TEXTIFY_QUEUE_ENABLED=true
TEXTIFY_QUEUE_CONNECTION=redis
TEXTIFY_QUEUE_NAME=sms
```

🚀 Quick Start
-------------

[](#-quick-start)

### Basic SMS Sending

[](#basic-sms-sending)

```
use DevWizard\Textify\Facades\Textify;

// Send a simple SMS
Textify::send('01712345678', 'Hello, this is a test message!');

// Send using specific driver
Textify::via('revesms')->send('01712345678', 'Hello from REVE SMS!');
```

### Fluent API

[](#fluent-api)

```
// Chain methods for more control
Textify::to('01712345678')
    ->message('Your OTP is: 123456')
    ->via('mimsms')
    ->send();

// Send to multiple recipients
Textify::to(['01712345678', '01887654321'])
    ->message('Bulk SMS message')
    ->send();
```

### Laravel Notifications

[](#laravel-notifications)

```
// Create and send SMS notifications
$user->notify(new OrderShippedNotification('ORD-123'));

// Or send to any phone number
Notification::route('textify', '01712345678')
    ->notify(new WelcomeNotification());
```

🔔 Laravel Notifications
-----------------------

[](#-laravel-notifications)

Laravel Textify provides seamless integration with Laravel's notification system, allowing you to send SMS notifications just like email or database notifications.

### Quick Setup

[](#quick-setup)

1. **Add `textify` to your notification channels:**

```
public function via($notifiable): array
{
    return ['textify']; // or ['mail', 'textify'] for multiple channels
}
```

2. **Implement the `toTextify()` method:**

```
public function toTextify($notifiable): TextifyMessage
{
    return TextifyMessage::create('Your order has been shipped!');
}
```

3. **Configure phone number resolution in your model:**

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

### Complete Notification Example

[](#complete-notification-example)

```
