承接 misaf/laravel-sms-gateway-smsir 相关项目开发

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

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

misaf/laravel-sms-gateway-smsir

Composer 安装命令:

composer require misaf/laravel-sms-gateway-smsir

包简介

Sms.ir driver package for misaf/laravel-sms-gateway.

README 文档

README

Sms.ir driver package for misaf/laravel-sms-gateway.

This package registers the smsir driver. The core package provides the manager, facade, driver contract, shared configuration file, and SmsSent event.

Requirements

  • PHP 8.2+
  • Laravel 10, 11, 12, or 13
  • misaf/laravel-sms-gateway

Installation

composer require misaf/laravel-sms-gateway-smsir

Laravel package discovery registers the driver service provider automatically.

Configuration

Publish the core configuration file if it has not already been published:

php artisan vendor:publish --tag=sms-gateway-config

Set the default driver and Sms.ir credentials in .env:

SMS_GATEWAY_DRIVER=smsir
SMS_GATEWAY_SMSIR_API_KEY=your-api-key
SMS_GATEWAY_SMSIR_API_KEY_HEADER=X-API-KEY
SMS_GATEWAY_SMSIR_GATEWAY=https://api.sms.ir/v1/
SMS_GATEWAY_SMSIR_TIMEOUT=10
SMS_GATEWAY_SMSIR_CONNECT_TIMEOUT=5

The driver reads from the smsir key in config/sms_gateway.php:

'smsir' => [
    'apiKey'          => env('SMS_GATEWAY_SMSIR_API_KEY', ''),
    'apiKeyHeader'    => env('SMS_GATEWAY_SMSIR_API_KEY_HEADER', 'X-API-KEY'),
    'gateway'         => env('SMS_GATEWAY_SMSIR_GATEWAY', 'https://api.sms.ir/v1/'),
    'timeout'         => (int) env('SMS_GATEWAY_SMSIR_TIMEOUT', env('SMS_GATEWAY_TIMEOUT', 10)),
    'connect_timeout' => (int) env('SMS_GATEWAY_SMSIR_CONNECT_TIMEOUT', env('SMS_GATEWAY_CONNECT_TIMEOUT', 5)),
],

Usage

use Misaf\LaravelSmsGateway\Facade\SmsGateway;

SmsGateway::driver('smsir')->send()->post('send', [
    'mobile'  => '09123456789',
    'message' => 'Hello',
]);

Sms.ir requests use the configured gateway, accept JSON responses, and send the API key in the configured header name.

Events

After a request receives a response, the core package dispatches Misaf\LaravelSmsGateway\Events\SmsSent with the driver name, request, and response.

Testing

composer test

License

MIT

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固