textlk/textlk-php

PHP SDK for Text.lk - SMS Gateway Sri Lanka

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 SMS Gateway Sri Lanka - PHP SDK

Latest Stable Version Total Downloads Latest Unstable Version License

It is a PHP package that will serve as a gateway to communicate with Text.lk REST APIs.

Installation

composer require textlk/textlk-php

Pure 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
}