承接 altrntv/sms-ru 相关项目开发

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

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

altrntv/sms-ru

Composer 安装命令:

composer require altrntv/sms-ru

包简介

SMS.RU Notifications channel for Laravel.

README 文档

README

This package makes it easy to send notifications using sms.ru with Laravel ^12.x.

Contents

Installation

Install this package with Composer:

composer require altrntv/sms-ru

Setting up the SmsRu service

Add your SmsRu Api ID and Host to your config/services.php:

...
'smsru' => [
    'api_id'  => env('SMS_RU_API_ID'),
    'host' => env('SMS_RU_API_HOST'),
],
...

Usage

You can use the channel in your via() method inside the notification:

use Altrntv\SmsRu\SmsRuMessage;
use Altrntv\SmsRu\SmsRuChannel;
use Illuminate\Notifications\Notification;

class OrderStatus extends Notification
{
    public function via(mixed $notifiable): array
    {
        return [
            SmsRuChannel::class,
        ];
    }

    public function toSmsRu(mixed $notifiable): SmsRuMessage
    {
        return SmsRuMessage::create('Message');
    }
}

In your notifiable model, make sure to include a routeNotificationForSmsRu() method, which returns a phone number or an array of phone numbers.

public function routeNotificationForSmsRu(): ?string
{
    return $this->phone;
}

Available Message methods

Method Description
to() Set a phone number
from(?string $from) Sender's name (must be agreed with the administration). If it is not filled in, your default sender will be specified as the sender.
ip(?string $ip) User's IP address
sendAt(?CarbonInterface $time) If you need a delayed dispatch, specify the time of dispatch. It is specified in UNIX TIME format (example: 1280307978). It must be no more than 2 months from the date of submitting the request. If the time is less than the current time, the message is sent immediately.
ttl(?int $ttl) The message lifetime is in minutes (from 1 to 1440).
daytime(bool $daytime = true) Takes into account the recipient's time zone.
translit(bool $translit = true) Translates all Russian characters into Latin.
test(bool $test = true) Simulates sending a message to test your programs for the correct processing of server responses. However, the message itself is not sent and the balance is not spent.
partnerId(?string $partnerId) If you participate in an affiliate program, specify this parameter in the request and receive a percentage of the cost of the sent messages. Your unique identifier is already specified in the parameter.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固