承接 hivelink/laravel 相关项目开发

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

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

hivelink/laravel

最新稳定版本:v1.0.5

Composer 安装命令:

composer require hivelink/laravel

包简介

HiveLink Operator Library for Laravel!

README 文档

README


Logo

Hivelink Laravel SDK

SDK for implementing Hivelink SMS,Inquiry API in your Laravel projects.
Explore the docs »

Hivelink Laravel

First of all you will ned an API Key . You can get one Here.

Supported Laravel Versions:
  • V.4
  • V.5
  • V.6
  • V.7
  • V.8
  • V.9
  • V.10

Installation

Step 1 - Install the package

  • Method 1: You can install hivelink/laravel with Composer directly in your project:
composer require hivelink/laravel

Step 2

Head to config/app.php and add this line to the end of providers Array:

Hivelink\Laravel\ServiceProvider::class,

So that array must me something like this:

'providers' => [
		/*
		* Laravel Framework Service Providers...
		*/
		.
		.
		.
		Hivelink\Laravel\ServiceProvider::class
]

Then in the config/app.php and add this line to the end of aliases Array:

'Hivelink' => Hivelink\Laravel\Facade::class,

Step 3 - Publish

Run this command in your project dirctory:

php artisan vendor:publish --provider="Hivelink\Laravel\ServiceProvider" --tag="config"

In the message appear, find the number of Hivelink, enter the related number then hit Enter.

Step 4 - Api-Key

Now you must define your API Key to project. for this head to config/hivelink.php then put your API KEY in the code:

<?php
return [
    'apikey' => ' ',
];

All Set

Usage

You can use the package where ever you want.

  • First use the class:
use Hivelink;

Then use this pattern to send SMS:

try{
    $sender = "9000****";	

    $message = "این یک پیام تست می باشد";

    $receiver = array("090********");

    $result = Hivelink::SendSimple($sender,$receiver ,$message);
    if($result){
        foreach($result as $r){
            var_dump($r)
        }
    }
}
catch(\Hivelink\Exceptions\ApiException $e){
    echo $e->errorMessage();
}
catch(\Hivelink\Exceptions\HttpException $e){
    echo $e->errorMessage();
}catch(\Exceptions $ex){
    echo $ex->getMessage()
}

Use this method get account balanced :

try{
    $result = Hivelink::getCredit();
    if($result){
        var_dump($result);
    }
}
catch(\Hivelink\Exceptions\ApiException $e){
    echo $e->errorMessage();
}
catch(\Hivelink\Exceptions\HttpException $e){
    echo $e->errorMessage();
}

Contribution

https://notif.hivelink.co

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-11-07