webazin/kavenegar 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

webazin/kavenegar

Composer 安装命令:

composer require webazin/kavenegar

包简介

KaveNegar.com webservice for Laravel

README 文档

README

#KaveNegar

Installation

Step 1: Run this command:

composer require webazin/kavenegar

Step 2: Add provider in config/app.php

'providers' => [
    ...
    webazin\KaveNegar\KaveNegarServiceProvider::class, //<--add this line at the end of provider array
]

Step 3: Run this command:

php artisan vendor:publish

Configuration file is placed in config/kavenegar.php , open it and enter your kavenegar.com api token

Usage

use the kavenegar class on your Controller:

use webazin/KaveNegar/SMS;

a basic example of send a sms

public function sms(SMS $sms)
    {
        try {
            $sender = "10006707323323";
            $message = "Hello Api";
            $receptor = ['0937XXXXXXX', '0933XXXXXXX']; // reciver phone number as a array
            $date = null;
            $type = 1;
            $localIds = ['1','2'];
            $result = $sms->Send($receptor, $sender, $message, $date, $type, $localIds);
            dd($result); // or anything do with $result
        } catch (ApiException $e) {
            return $e->errorMessage();
        } catch (HttpException $e) {
            return $e->errorMessage();
        }
    }
    

a basic example of make a call

  
public function call(SMS $sms){
   try {
	$receptor = $mobile;
	$message  = "call message";
	$date     = "";
	$localid  = "";
	$result   = $sms->CallMakeTTS( $receptor , $message , $date , $localid );    
        }
    catch ( HttpException $e ) {
	echo $e->errorMessage();
	}
 }
                

for more info see Kavenegar.com Official Document

وب آذین

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固