承接 granada-pride/unifonic-sms 相关项目开发

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

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

granada-pride/unifonic-sms

Composer 安装命令:

composer require granada-pride/unifonic-sms

包简介

A Laravel package for integrating Unifonic SMS with the Laravel notification system.

README 文档

README

Github All Releases

Unifonic SMS for Laravel

Unifonic SMS is a Laravel package that provides seamless integration with the Unifonic SMS service. It allows you to send SMS messages through the Unifonic platform using Laravel's native notification system. Whether you need to send OTPs, alerts, or marketing messages, this package simplifies the process by integrating directly into Laravel.

Features

  • Seamless Integration: Easily send SMS notifications through Unifonic.
  • Configurable: Adjust settings via the Laravel config system.
  • Error Handling: Full support for exception handling and logging.
  • Laravel Compatibility: Compatible with Laravel 8.x, 9.x, and 10.x.
  • Secure: Handles sensitive data securely.

Table of Contents

Installation

To get started, install the package via Composer:

composer require granada-pride/unifonic-sms

Requirements

  • PHP >= 8.0
  • Laravel >= 8.x

Configuration

After installing the package, publish the configuration file:

php artisan vendor:publish --provider="GranadaPride\UnifonicSms\UnifonicSmsServiceProvider"

This will publish a unifonic.php configuration file to your config directory where you can set your AppSid, SenderID, and Endpoint.

Configuration Options

Example configuration (config/unifonic.php):

return [
    'appsId' => env('UNIFONIC_APP_SID', 'your-app-sid'),
    'senderId' => env('UNIFONIC_SENDER_ID', 'your-sender-id'),
    'endpoint' => env('UNIFONIC_ENDPOINT', 'https://el.cloud.unifonic.com/rest/SMS/messages'),
];

To enable logging for the Unifonic SMS package, you can add a custom log channel in your config/logging.php file:

'channels' => [
    // Other log channels...

    'unifonic' => [
        'driver' => 'single',
        'path' => storage_path('logs/unifonic.log'),
        'level' => 'error',
    ],
],

This configuration ensures that Unifonic SMS logs are stored in a separate log file at storage/logs/unifonic.log and only logs messages with a severity level of error or higher.

Usage

After configuring the package, you can send SMS notifications:

use GranadaPride\UnifonicSms\Notifications\UnifonicSmsNotification;

$phone = '1234567890';
$message = "Your verification code is 123456";

$user->notify(new UnifonicSmsNotification($phone, $message));

Advanced Usage

To customize the SMS further or handle different scenarios, you can modify the notification class:

use GranadaPride\UnifonicSms\Notifications\UnifonicSmsNotification;

class CustomSmsNotification extends UnifonicSmsNotification
{
    public function toSms($notifiable)
    {
        return [
            'phone' => $this->phone,
            'message' => "Your custom message",
        ];
    }
}

// Sending the custom SMS
$user->notify(new CustomSmsNotification($phone, $message));

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue to improve this package.

License

This package is open-source software licensed under the MIT License. Please see the License File for more information.

granada-pride/unifonic-sms 适用场景与选型建议

granada-pride/unifonic-sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 723 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 08 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 granada-pride/unifonic-sms 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-12