承接 kagga/telco 相关项目开发

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

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

kagga/telco

Composer 安装命令:

composer require kagga/telco

包简介

Wrapper around the AfricasTalking api

README 文档

README

Telco is a package wrapper around the AfricasTalking api. This package has been developed for Laravel 5+.

The package makes it easy to send an sms from your application to a phone.

Installation

As other laravel packages, Telco is installed via composer.

In your terminal at the project root run

composer require kagga/telco

After add the service provider to config/app.php in the providers section

'providers' => [ 
            Kagga\Telco\TelcoServiceProvider::class 
    ],

Then also add the Facade aliases in config/app.php within the alias section.

'aliases' => [
        'Telco' => Kagga\Telco\facades\Telco::class,
    ],

Configuration

Now we are going to config the AfricasTalking api. Head over to your account or sign up to get your api key and username and jey hold of them.

Publish the package config file to the config folder in your app by running this in your terminal.

php artisan vendor:publish --tag=config

The config file called telco.php will be moved to config/telco.php.

Then add your username and api key to the .env file using these keys

SMS_USERNAME=yourUsername
SMS_API_KEY=yourapi-key

Thats all with the configuration.

You are about to get done, just one for thing. You can test out whether its working by serving your app php artisan serve and checking http://localhost/telco/send The view at this url comes bundled in the package only for testing purposes.

A success message will be showed after you send the message or an error message if something goes wrong.

Usage

At the moment the package has two methods, one for sending send an sms and the other the api that exposes the AfricasTalking Gateway.

With the api method you can access all the public methods in the AfricasTalkingGateway .

Example code

Illuminate\Support\Facades\Route::post('/telco/send', function (\Kagga\Telco\contracts\TelcoInterface $telco) {

  $phonenumber = request('tel'); //Used the request laravel helper to get the phone number from a phone

  $message = request('message'); //Getting the message from the form
  
  $results = $telco->send($phonenumber, $message);
  
  if ($results != null) {

      return "Message has been sent successful to " . $phonenumber;
  }
});

You can also use the Telco facade that comes with the package to send a message.

Telco::send($phonenumber, $message);

Do not forget to add the facade import statement use Kagga\Telco\facades\Telco;

Thats it.

Thanks for using this package.

Let me know what you develop with this package. By sending me an email Johnkagga@gmail.com or @johnkagga

kagga/telco 适用场景与选型建议

kagga/telco 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 191 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 01 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-17