承接 nextgen-tech/laravel-multiinfo 相关项目开发

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

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

nextgen-tech/laravel-multiinfo

Composer 安装命令:

composer require nextgen-tech/laravel-multiinfo

包简介

README 文档

README

MultiInfo integration for Laravel.

Installation

composer require nextgen-tech/laravel-multiinfo

Configuration

MULTIINFO_CONNECTION=                    # Connection type (http is the only one supported)
MULTIINFO_API_VERSION=                   # API version (api1 or api2)
MULTIINFO_CERTIFICATE_PUBLIC_KEY_PATH=   # Path to certificate public key
MULTIINFO_CERTIFICATE_PRIVATE_KEY_PATH=  # Path to certificate private key
MULTIINFO_CERTIFICATE_PASSWORD=          # Certificate password
MULTIINFO_CREDENTIALS_LOGIN=             # Service login
MULTIINFO_CREDENTIALS_PASSWORD=          # Service password
MULTIINFO_CREDENTIALS_SERVICE_ID=        # Service ID

Certificate needs to be in PEM format. You can convert P12 to PEM using this two scripts:

openssl pkcs12 -in "/path/to/cert.p12" -out public_key.pem -nocerts -nodes
openssl pkcs12 -in "/path/to/cert.p12" -out private_key.pem -clcerts -nokeys

Usage

Via notification channel:

// app/Models/User.php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Notifications\Notification;

class User extends Model
{
    use Notifiable;

    ...

    public function routeNotificationForMultiinfo(?Notification $notification): string
    {
        return $this->phone;
    }

    ...
}

// app/Notifications/ExampleNotification.php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use NGT\Laravel\MultiInfo\MultiInfoMessage;

class ExampleNotification extends Notification
{
    public function via($notifiable): array
    {
        return ['multiinfo'];
    }

    public function toMultIinfo($notifiable): MultiInfoMessage
    {
        return (new MultiInfoMessage())
            ->content('test message');
    }
}

Or directly via handler:

use NGT\MultiInfo\Handler;
use NGT\MultiInfo\Requests\SendSmsRequest;

$handler = app(Handler::class);

$request = app(SendSmsRequest::class)
    ->setDestination('123123123')
    ->setContent('test message');

/** @var \NGT\MultiInfo\Responses\SendSmsResponse */
$response = $handler->handle($request);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固