textlk/textlk-php

Text.lk - 斯里兰卡短信网关的PHP SDK

v2.0.4 2024-02-13 12:43 UTC

This package is auto-updated.

Last update: 2024-09-17 09:36:21 UTC


README

Text.lk短信网关 - 斯里兰卡 - PHP SDK

Latest Stable Version Total Downloads Latest Unstable Version License

这是一个PHP包,作为与Text.lk REST API通信的网关。

安装

composer require textlk/textlk-php

纯PHP

use TextLK\SMS\TextLKSMSMessage;

$textLKSMS = new TextLKSMSMessage();

$textLKSMS
    ->recipient("94712345678") // Replace with the recipient's phone number.
    ->message("Hello, this is a test message.")
    ->senderId("YOUR_SENDER_ID") // (optional) TEXTLK_SMS_SENDER_ID can be added in .env
    ->apiKey('YOUR_API_KEY_HERE') // (optional) TEXTLK_SMS_API_KEY can be added in .env

$textLKSMS->send();

Laravel

public function toTextlk($notifiable)
{
    return (new \TextLK\SMS\TextLKSMSMessage)
        ->recipient("94712345678") // Replace with the recipient's phone number.
        ->message('Hello, this is a test message.')
        ->senderId('YOUR_SENDER_ID') // optional. TEXTLK_SMS_SENDER_ID can be added in .env
        ->apiKey('YOUR_API_KEY_HERE') // optional. TEXTLK_SMS_API_KEY can be added in .env
}