Skip to content

Text.lk - SMS Gateway Sri Lanka - REST API client for PHP. API support for SMS, OTP, Verify (2FA).

License

Notifications You must be signed in to change notification settings

textlk/textlk-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

textlk-php

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
}