danialpanah/farapayamak
Composer 安装命令:
composer require danialpanah/farapayamak
包简介
Laravel Package For Sending Text Messages(SMS) Through Farapayamak API.
README 文档
README
Introduction
By using this package you can send SMS Text Messages through Farapayamak RESTful Web Services with your Laravel application.
Installation
- Use following command to install:
composer require danialpanah/farapayamak
This package supports Laravel auto-discovery feature. If you are using Laravel 5.5 or greater no need to do any further actions, otherwise follow below steps.
- Add the service provider to your
providers[]array inconfig/app.phpin your laravel application:
DanialPanah\Farapayamak\FarapayamakServiceProvider::class
- For using Laravel Facade add the alias to your
aliases[]array inconfig/app.phpin your laravel application:
'Farapayamak': DanialPanah\Farapayamak\Facades\Farapayamak::class
Configuration
-
After installation, you need to add you Farapayamak settings. You can update config/farapayamak.php published file or in you Laravel .env file.
-
Run the following command to publish the configuration file:
php artisan vendor:publish --provider "DanialPanah\Farapayamak\FarapayamakServiceProvider"
- config/farapayamak.php
return [ 'username' => env('FARAPAYAMAK_USERNAME', ''), 'password' => env('FARAPAYAMAK_PASSWORD', ''), 'from' => env('FARAPAYAMAK_FROM', '') ];
- Add this to
.env.exampleand.envfiles:
#Farapayamak Credentials and settings
FARAPAYAMAK_USERNAME=
FARAPAYAMAK_PASSWORD=
FARAPAYAMAK_NUMBER=
Usage
Following are some ways which you can have access to farapayamak package:
// Importing the class namespaces before using it
use DanialPanah\Farapayamak\Farapayamak;
$data = [
'to' => '09121111111',
'text' => 'Test Message..'
];
$textMessage = new Farapayamak();
$response = $textMessage->send($data);
- Using Facades:
use DanialPanah\Farapayamak\Facades\Farapayamak;
$response = Farapayamak::send($data);
- Sending to multiple recipients:
$numbers = ['09121111111', '09132222222', '09153333333'];
$data = [
'to' => $numbers,
'text' => 'Multicast Test Message..'
];
$response = Farapayamak::send($data);
Support & Security
This package supports Laravel 5.1 or greater, 6.x and 7.x
- In case of discovering any issues, please create one on the Issues section.
- For contribution, fork this repo and implements your code, then create a PR.
License
This repository is an open-source software under the MIT license.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-24