64robots/laravelthinq

v0.0.8 2021-10-12 10:14 UTC

README

Latest Version on Packagist Total Downloads Build Status StyleCI

这里应该放置你的描述。查看contributing.md以获取待办事项清单。

安装

通过Composer

$ composer require 64robots/laravelthinq

使用方法

php artisan vendor:publish --provider="R64\LaravelThinq\LaravelThinqServiceProvider"

将以下内容添加到.env

THINQ_ACCOUNT_ID=Your thinq account id
THINQ_API_KEY=Your thinq api key

用作通知

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use R64\LaravelThinq\ThinqChannel;
use R64\LaravelThinq\ThinqMessage;

class TestThinq extends Notification
{
    use Queueable;

    public $silent = true; //if silent true, the service does not throw error

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [ThinqChannel::class];
    }

    public function toThinq($notifiable)
    {
        return new ThinqMessage('Send test sms', '122233333', '133333333');
    }

}

独立使用

$message = new ThinqMessage('Send test sms', '122233333', '133333333');

new Thinq()
    ->setMessage($message)
    ->sendSms() //throws error
    ->sendSilentSms() //does not throw error

变更日志

请参阅changelog以获取有关最近更改的更多信息。

测试

$ composer test

贡献

请参阅contributing.md以获取详细信息及待办事项清单。

安全

如果您发现任何安全问题,请通过电子邮件kliment.lambevski@gmail.com联系,而不是使用问题跟踪器。

致谢

许可证

MIT。请参阅许可证文件以获取更多信息。