davidvarney/plivo-complete
Composer 安装命令:
composer require davidvarney/plivo-complete
包简介
Complete Plivo driver for Laravel
README 文档
README
Plivo Complete is a simple Laravel 5 driver for the Plivo PHP library
Installation
Step 1
Install via composer
Method 1: via CLI (recommended)
$ composer require davidvarney/plivo-complete:1.0.0
Method 2: via composer.json
"require": { ... "davidvarney/plivo-complete": "1.0.0", },
Step 2
Laravel Service Provider
In the config/app.php file and within the 'providers' => [ array place the following towards the end of the array
'providers' => [ ... DavidVarney\Plivo\PlivoServiceProvider::class, ],
Laravel Alias
In the same config/app.php file and within the 'aliases' => [ array place the following towards the end of the array
'aliases' => [ ... 'Plivo' => DavidVarney\Plivo\Plivo::class, ],
Step 3
You don't have to run the dump-autoload command but I usually do just for good measure.
$ composer dump-autoload $ composer update
Step 4
Next we're going to create the necessary config file so that we can insert our Auth ID and Auth Token from our Plivo account
$ php artisan vendor:publish
After publishing the config file make your way to the config directory and look for the following file: config/plivo.php
You should see that the config file is looking for two environment variables. You have two options.
Option #1
Place the auth_token and auth_id within the env() function like so:
return [ 'auth_token' => env('PLIVO_AUTH_TOKEN', TOKEN_HERE), 'auth_id' => env('PLIVO_AUTH_ID', ID_HERE) ];
Option #2 (recommended)
You can simply leave the config file alone and place the 'PLIVO_AUTH_TOKEN' and 'PLIVO_AUTH_ID' inside of the .env file.
...
PLIVO_AUTH_TOKEN=YOUR_AUTH_TOKEN_HERE
PLIVO_AUTH_ID=YOUR_AUTH_ID_HERE
Usage
Now you should be able to simply use it within a Controller like so
<?php namespace App\Http\Controllers\YourController; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Plivo; class YourController extends Controller { public function index() { $plivo = new Plivo; return view('myview.index', array( 'plivo' => $plivo )); } }
Then your view would look something like this:
@extends('layouts.frontend.app') @section('content') {!! dd($plivo->get_account()) !!} @endsection
You can use any RestAPI method that is available in the Plivo RestAPI PHP library
davidvarney/plivo-complete 适用场景与选型建议
davidvarney/plivo-complete 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「plivo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 davidvarney/plivo-complete 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 davidvarney/plivo-complete 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 davidvarney/plivo-complete 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Monolog Handler for SMS messaging services such as Twilio, Clickatell and Plivo.
A modern, flexible Laravel package for integrating any SMS gateway with REST API support
Send SMS using Plivo Cloud API
Symfony Plivo Notifier Bridge
Plivo Bundle for Symfony - Send and receive text messages
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-24