承接 susheelbhai/laravel-sms 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

susheelbhai/laravel-sms

Composer 安装命令:

composer require susheelbhai/laravel-sms

包简介

Multi-provider SMS integration for Laravel applications with notification channel support

README 文档

README

Multi-provider SMS package for Laravel with notification channel support.

Supported Providers

  • Fast2SMS — Quick SMS and OTP routes
  • MSG91 — Flow API and OTP API
  • Mock — Local/testing without API calls

Installation

composer require susheelbhai/laravel-sms
php artisan sms:install

Configuration

SMS_ENABLED=1
SMS_PROVIDER=fast2sms
SMS_COUNTRY_CODE=91
SMS_TEST_NUMBER=9999999999

FAST2SMS_API_KEY=your_api_key
FAST2SMS_SENDER_ID=FSTSMS
FAST2SMS_ROUTE=q
FAST2SMS_OTP_ROUTE=otp

MSG91_AUTH_KEY=your_auth_key
MSG91_SENDER_ID=SMSIND
MSG91_FLOW_ID=your_flow_id

When APP_ENV is not production, all SMS are redirected to SMS_TEST_NUMBER.

Direct Usage

use Susheelbhai\Sms\Facades\Sms;

Sms::send('9876543210', 'Your order is confirmed.');
Sms::sendOtp('9876543210', '482910');
Sms::via('msg91')->send('9876543210', 'Hello from MSG91');

Notification Channel

public function via(object $notifiable): array
{
    $channels = ['database'];

    if (config('sms.enabled') == 1 && isset($notifiable->phone)) {
        $channels[] = 'sms';
    }

    return $channels;
}

public function toSms(object $notifiable): array
{
    return ['message' => 'Your order has been placed.'];
}

public function toSmsOtp(object $notifiable): array
{
    return ['otp' => $this->otp];
}

Switching Providers

Set SMS_PROVIDER in .env to fast2sms, msg91, or mock.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固