PHP code example of hivelink / laravel

1. Go to this page and download the library: Download hivelink/laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hivelink / laravel example snippets


composer 

Hivelink\Laravel\ServiceProvider::class,

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

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

use Hivelink;

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()
}

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();
}

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


return [
    'apikey' => ' ',
];