承接 adedaramola/termii-notification-channel 相关项目开发

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

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

adedaramola/termii-notification-channel

Composer 安装命令:

composer require adedaramola/termii-notification-channel

包简介

Termii Notification Channel for Laravel

README 文档

README

Contents

Installation

composer require adedaramola/termii-notification-channel

Configuration

Ensure you add the following key to your environment file

TERMII_URL=
TERMII_API_KEY=
TERMII_SENDER_ID=

SMS Channel

Routing SMS Notifications

First, you need to define where the SMS notifications needs to be routed to. Define a routeNotificationForTermiiSms method on your notifiable entity. Ensure the phone number is internationally formatted (i.e, 2349001111222).

<?php

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Notifications\Notification;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Route notifications for the Termii sms channel.
     */
    public function routeNotificationForTermiiSms(Notification $notification): string
    {
        return $this->phone_number;
    }
}

Formatting SMS Notifications

If a notification should be sent using Termii SMS, the notification class must first implement the Adedaramola\TermiiNotificationChannel\Contracts\TermiSmsNotification interface, this requires you to define a toTermiiSms method on the notification entity

<?php

namespace App\Notifications;

use Adedaramola\TermiiNotificationChannel\Channels\TermiiSmsChannel;
use Adedaramola\TermiiNotificationChannel\Contracts\TermiiSmsNotification;
use Adedaramola\TermiiNotificationChannel\Messages\TermiiSmsMessage;
use Illuminate\Notifications\Notification;

class WelcomeNotification extends Notification implements TermiiSmsNotification
{
    public function via(object $notifiable): array
    {
        return [TermiiSmsChannel::class];
    }

    public function toTermiiSms(object $notifiable): TermiiSmsMessage
    {
        return (new TermiiSmsMessage)
            ->content('This is a test notification');
    }
}

Sending SMS using DND channel

By default, all sms messages will be sent using the generic channel. This behaviour can be customised by calling

Termii::useDefaultSmsChannel(Channel::DND);

This should ideally be called the the boot method of your AppServiceProvider. Alternatively, you can also call the useDnd method on the message class.

use Adedaramola\TermiiNotificationChannel\Messages\TermiiSmsMessage;

public function toTermiiSms(object $notifiable): TermiiSmsMessage
{
    return (new TermiiSmsMessage)
        ->content('This should be sent through the dnd channel')
        ->useDnd();
}

Customizing the SMS message type

You can specify the format of the message being sent. Supported types includes, plain, unicode, voice.

use Adedaramola\TermiiNotificationChannel\Enums\Type;
use Adedaramola\TermiiNotificationChannel\Messages\TermiiSmsMessage;

public function toTermiiSms(object $notifiable): TermiiSmsMessage
{
    return (new TermiiSmsMessage)
        ->content('This should be sent using another type')
        ->type(Type::UNICODE);
}

Whatsapp Channel

Termii also supports sending messages to whatsapp.

Routing Whatsapp Notifications

You also need to define where the whatsapp notifications needs to be routed to. Define a routeNotificationForTermiiWhatsapp method on your notifiable entity. Ensure the phone number is internationally formatted (i.e, 2349001111222).

Sending Whatsapp Notifications

If a notification should be sent using Termii Whatsapp, the notification class must first implement the Adedaramola\TermiiNotificationChannel\Contracts\TermiWhatsappNotification interface, this requires you to define a toTermiiWhatsapp method on the notification entity

<?php

namespace App\Notifications;

use Adedaramola\TermiiNotificationChannel\Channels\TermiiWhatsappChannel;
use Adedaramola\TermiiNotificationChannel\Contracts\TermiiWhatsappNotification;
use Adedaramola\TermiiNotificationChannel\Messages\TermiiWhatsappMessage;
use Illuminate\Notifications\Notification;

class WelcomeNotification extends Notification implements TermiiWhatsappNotification
{
    public function via(object $notifiable): array
    {
        return [TermiiWhatsappChannel::class];
    }

    public function toTermiiWhatsapp(object $notifiable): TermiiWhatsappMessage
    {
        return (new TermiiWhatsappMessage)
            ->content('This is a test notification')
            ->mediaUrl('https://link.to/media')
            ->mediaCaption('This is a sample media');
    }
}

License

Termii Notification Channel is open-sourced software licensed under the MIT license.

adedaramola/termii-notification-channel 适用场景与选型建议

adedaramola/termii-notification-channel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 adedaramola/termii-notification-channel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 adedaramola/termii-notification-channel 我们能提供哪些服务?
定制开发 / 二次开发

基于 adedaramola/termii-notification-channel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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