mmockelyn/laravel-ovh-sms
Composer 安装命令:
composer require mmockelyn/laravel-ovh-sms
包简介
OVH SMS API integration for Laravel 7+.
README 文档
README
This is an unofficial OVH SMS integration of the ovh/php-ovh library for Laravel 7+.
- Original PHP OVH library
- Based on Nexmo notification channel
Summary
Installation
Currently, this package isn't packaged with packagist (https://packagist.org/). You must add a private repository to your composer.json file in order to use this package. You can add private repository in your composer.json file by adding this section :
{
"repositories": [
{
"name": "orykami/laravel-ovh-sms",
"type": "git",
"url": "https://github.com/orykami/laravel-ovh-sms"
}
]
}
Require this package with composer:
composer require orykami/laravel-ovh-sms
After updating composer, add the ServiceProvider to the providers array in config/app.php:
Illuminate\Notifications\OvhSmsChannelServiceProvider::class,
Configuration
This package require some configuration in config/services.php
return [ // Add configuration to third party services 'ovh' => [ 'app_key' => env('OVH_APP_KEY', 'YOUR_APP_KEY_HERE'), 'app_secret' => env('OVH_APP_SECRET', 'YOUR_APP_SECRET_HERE'), 'endpoint' => env('OVH_ENDPOINT', 'OVH_ENDPOINT_HERE'), 'consumer_key' => env('OVH_CONSUMER_KEY', 'YOUR_CONSUMER_KEY_HERE'), 'sms_account' => env('OVH_SMS_ACCOUNT', 'sms-xxxxxxx-x'), 'sms_default_sender' => env('OVH_SMS_DEFAULT_SENDER', 'SENDER_NAME')), 'sms_sandbox_mode' => env('OVH_SMS_SANDBOX_MODE', false)), ], ];
Using with Laravel Notifications
This package can be used as a driver for Laravel Notifications (Laravel >= 7.X).
Example notification
Here's a simple notification example.
namespace App\Notifications; use Illuminate\Notifications\Channels\OvhSmsChannel; use Illuminate\Notifications\Messages\OvhSmsMessage; use Illuminate\Notifications\Notification; class ExampleNotification extends Notification { /** * Notification via OvhSmsChannel. */ public function via($notifiable) { return [OvhSmsChannel::class]; } /** * Your notification must implements "toOvh()" */ public function toOvh($notifiable) { return (new OvhSmsMessage('A new invoice was paid! Amount: $9.00')); } }
Also, your Notifiable model must implements routeNotificationForOvhSms().
namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; /** * Returns the user's phone number. */ public function routeNotificationForOvhSms() { return $this->phone; // Ex: +33611223344 } }
You're all set to use the new Laravel Notifications system ! :-) Be aware that Channel method send will return OVH credits consumed (if needed for quotas/metrics).
Licence
MIT
mmockelyn/laravel-ovh-sms 适用场景与选型建议
mmockelyn/laravel-ovh-sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 106 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 08 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「sms」 「laravel」 「ovh」 「laravel7」 「laravel8」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mmockelyn/laravel-ovh-sms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mmockelyn/laravel-ovh-sms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mmockelyn/laravel-ovh-sms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
yii2-sms expand
Alfabank REST API integration
A fork of simplesoftwareio/simple-sms with Verimor driver.
统计信息
- 总下载量: 106
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-11