Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Fast2Sms Laravel Package

itxshakil/laravel-fast2sms

View on GitHub
Deep Wiki
Context7

SMS Guide

This guide covers all SMS sending options available in Laravel Fast2SMS.


Routes Overview

Route Enum Use Case
Quick SmsRoute::QUICK Promotional / general messages
OTP SmsRoute::OTP One-time passwords
DLT SmsRoute::DLT Transactional messages (DLT registered)
DLT Manual SmsRoute::DLT_MANUAL DLT with manual template variables

Quick SMS

Send a simple message without DLT registration:

use Shakil\Fast2sms\Facades\Fast2sms;

$response = Fast2sms::quick(
    numbers: '9876543210',
    message: 'Hello from Fast2SMS!',
);

OTP SMS

Send a one-time password using a pre-approved OTP template:

$response = Fast2sms::otp(
    numbers: '9876543210',
    otpValue: '123456',
);

DLT SMS

Send a DLT-registered transactional message:

$response = Fast2sms::dlt(
    numbers: ['9876543210', '9123456789'],
    templateId: 'your_dlt_template_id',
    variablesValues: 'Your order #1234 has been shipped.',
    senderId: 'MYSHOP',
);

DLT with Variables

$response = Fast2sms::dlt(
    numbers: '9876543210',
    templateId: 'your_template_id',
    variablesValues: ['John', '654321'],
    senderId: 'MYAPP',
);

Flash SMS

Flash SMS appears directly on the recipient's screen without being stored:

$response = Fast2sms::to('9876543210')
    ->message('This is a flash message!')
    ->flash()
    ->send();

Multiple Recipients

Pass an array of numbers to send to multiple recipients in one API call:

$response = Fast2sms::quick(
    numbers: ['9876543210', '9123456789', '9000000001'],
    message: 'Broadcast message to all users',
);

Note: Fast2SMS supports up to 1000 numbers per API call.


Checking the Response

All send methods return an SmsResponse object:

$response = Fast2sms::quick(numbers: '9876543210', message: 'Hello!');

if ($response->isSuccess()) {
    echo 'Sent! Request ID: ' . $response->requestId;
} else {
    echo 'Failed: ' . $response->message;
}

SmsResponse Properties

Property Type Description
isSuccess() bool Whether the send was accepted
requestId string|null Unique request ID from Fast2SMS
message string API response message
data array Raw response data

Using SmsMessage Builder

For notification-style usage, use the fluent SmsMessage builder:

use Shakil\Fast2sms\Enums\SmsRoute;
use Shakil\Fast2sms\Notifications\Messages\SmsMessage;

$message = SmsMessage::create('Your OTP is 123456')
    ->withRoute(SmsRoute::QUICK)
    ->withNumbers(['9876543210', '9123456789']);

Wallet Balance

Check your remaining SMS balance:

$balance = Fast2sms::checkBalance();

echo 'Balance: ₹' . $balance->balance;

DLT Manager Details

Retrieve your DLT registration details:

use Shakil\Fast2sms\Enums\DltManagerType;

$dlt = Fast2sms::dltManager(DltManagerType::SENDER);

See Also

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium