定制 midnite81/plivo 二次开发

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

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

midnite81/plivo

最新稳定版本:v0.1.10

Composer 安装命令:

composer require midnite81/plivo

包简介

A Plivo SMS integration for Laravel

关键字:

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License
A Plivo SMS integration for Laravel

Project is archived

Since producing this package, Plivo have updated their own API package which is comprehensive. As such I've decided to archive this project as I am not doing any current development on it.

Installation

This package requires PHP 5.6+, and includes a Laravel 5 Service Provider and Facade.

To install through composer include the package in your composer.json.

"midnite81/plivo": "0.1.*"

Run composer install or composer update to download the dependencies or you can run composer require midnite81/plivo.

Refresh Autoloader

At this point some users may need to run the command composer dump-autoload. Alternatively, you can run php artisan optimize which should include the dump-autoload command.

Laravel 5 Integration

To use the package with Laravel 5 firstly add the Messaging service provider to the list of service providers in app/config/app.php.

'providers' => [
  Midnite81\Plivo\MessagingServiceProvider::class
];

Add the Messaging facade to your aliases array.

'aliases' => [
  'Messaging' => Midnite81\Plivo\Facades\Messaging::class,
];

Publish the config and migration files using

php artisan vendor:publish --provider="Midnite81\Plivo\MessagingServiceProvider"

To access Plivo/Messaging you can either use the Facade or the Messaging instance is bound to the IOC container and you can then dependency inject it via its contract.

Messaging::get('foo');

public function __construct(Midnite81\Plivo\Contracts\Services\Messaging $messaging)
{
    $this->messaging = $messaging;
}

Configuration File

Once you have published the config files, you will find a Plivo.php file in the config folder. You should look through these settings and update these where necessary.

Env

You will need to add the following to your .env file and update these with your own settings

PLIVO_AUTH_ID=<auth_id>
PLIVO_AUTH_TOKEN=<auth_token>
PLIVO_SOURCE_NUMBER=<default_sms_number>

Example Usage

use Midnite81\Plivo\Contracts\Services\Messaging;
    
public function sendMessage(Messaging $messaging) 
{
    $msg = $messaging->msg('Hello World!')->to('0123456789')->sendMessage(); 
}

// Or you can simply use the helper function
   
text('+44123456789', 'Just reminding you to attend the Dentist at 3.30pm');

Text takes three arguments, to, message and optionally from.

// If text is already defined as a function in your application you can use
text_message($to, $message, $from); // or
plivo_send_text($to, $message, $from);

midnite81/plivo 适用场景与选型建议

midnite81/plivo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.35k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2016 年 04 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「sms」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 midnite81/plivo 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-16