定制 smsfactor/smsfactor-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

smsfactor/smsfactor-laravel

最新稳定版本:v1.1.1

Composer 安装命令:

composer require smsfactor/smsfactor-laravel

包简介

Laravel package for SMSFactor API

README 文档

README

The Laravel Service Provider that allows you to use SMSFactor PHP Client library.

In order to use it, make sure to have an account. You can register here. Once your account is created, you need to generate your first API token. You can find the complete documentation of our API here.

Installation

We recommend using Composer to install the PHP client library to your project.

composer require smsfactor/smsfactor-laravel

Laravel 5.5+

If you're using Laravel 5.5 or above, the package will automatically register the SMSFactor provider and facades.

Laravel 5.4 and below

Add SMSFactor\Laravel\SMSFactorServiceProvider to the providers array in your config/app.php:

'providers' => [
    // Other service providers...
    SMSFactor\Laravel\SMSFactorServiceProvider::class,
],

If you want to use the a facade interface, you can use any of them depending on your need:

use SMSFactor\Laravel\Facade\Account;
use SMSFactor\Laravel\Facade\Campaign;
use SMSFactor\Laravel\Facade\ContactList;
use SMSFactor\Laravel\Facade\Message;
use SMSFactor\Laravel\Facade\Webhook;
use SMSFactor\Laravel\Facade\Token;

Or add any alias in your config/app.php:

'aliases' => [
    ...
    'SMSFactor' => SMSFactor\Laravel\Facade\Account::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\Campaign::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\ContactList::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\Message::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\Webhook::class,
    'SMSFactor' => SMSFactor\Laravel\Facade\Token::class,
],

Configuration

You can use artisan vendor:publish to copy the distribution configuration file to your app's config directory:

php artisan vendor:publish

Then update config/smsfactor.php with your token.

Usage

To use the SMSFactor Client Library you can use the facades, or request an instance from the service container:

$response = Message::send([
	'to' => '33600000000',
	'text' => 'Have you ever danced with the devil in the pale moonlight ?'
]);
print_r($response->getJson()); //In case you don't receive your text, printing the API response might be useful

or

$account = app('SMSFactor\Message');
$response = $account->send([
	'to' => '33600000000',
	'text' => 'Have you ever danced with the devil in the pale moonlight ?'
]);
print_r($response->getJson());

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固