定制 cyberwolfstudio/laravel-smsmapi-notifications 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

cyberwolfstudio/laravel-smsmapi-notifications

Composer 安装命令:

composer require cyberwolfstudio/laravel-smsmapi-notifications

包简介

SmsAPI Notifications Channel for Laravel

README 文档

README

Software License

Laravel notification channel for sending SMS via SmsAPI. Supports both Polish (smsapi.pl) and international (smsapi.com) services.

Compatible with Laravel 6.x through 12.x.

Installation

composer require cyberwolfstudio/laravel-smsmapi-notifications

The service provider is auto-discovered. No manual registration needed.

Configuration

Add your SmsAPI token to config/services.php:

'smsapi' => [
    'token' => env('SMSAPI_AUTH_TOKEN'),
],

Optionally set the service region in config/smsapi.php:

// 'pl' (default) or 'com'
'service' => env('SMSAPI_SERVICE', 'pl'),

Usage

Implement the SmsAPINotification contract on your notification and return an SmsAPIMessage:

use Illuminate\Notifications\Notification;
use CyberWolfStudio\LaravelSmsAPINotifications\SmsAPIPlChannel;
use CyberWolfStudio\LaravelSmsAPINotifications\SmsAPIMessage;
use CyberWolfStudio\LaravelSmsAPINotifications\Contracts\SmsAPINotification;

class OrderShipped extends Notification implements SmsAPINotification
{
    public function via($notifiable): array
    {
        return [SmsAPIPlChannel::class];
    }

    public function toSmsAPI($notifiable): SmsAPIMessage
    {
        return new SmsAPIMessage('Your order has been shipped!');
    }
}

Routing

Add a routeNotificationForSmsapi method to your notifiable model to return the phone number:

public function routeNotificationForSmsapi(): string
{
    return $this->phone_number;
}

To send to a contacts group instead, add routeNotificationForSmsapiGroup:

public function routeNotificationForSmsapiGroup(): string
{
    return $this->contacts_group;
}

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固