Download the PHP package varaai/varasms without Composer

On this page you can find all versions of the php package varaai/varasms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package varasms

VaraSMS Laravel Package

A Laravel package for integrating with the VaraSMS messaging service. This package provides an easy way to send SMS messages, manage customer balances, and interact with the VaraSMS API.

Installation

You can install the package via composer:

Configuration

Publish the configuration file:

Add the following environment variables to your .env file:

For username/password authentication (default):

Or for token-based authentication:

Test Mode

When VARASMS_TEST_MODE is set to true, all API calls will be directed to the test endpoints. This is useful for development and testing without sending actual SMS messages.

Example test mode configuration:

Usage

Send a Single SMS

The sendSMS method supports both single and multiple recipients:

Parameter Description Format/Constraints
to Single phone number or array of numbers Must start with 255 followed by 9 digits
message The message to send String
senderId Optional custom sender ID String
reference Optional message reference String

Send SMS Response

Send Bulk SMS

Get Delivery Reports

Check Balance

Recharge Customer

Deduct Customer Balance

Get SMS Logs

The getSMSLogs method supports the following filters:

Filter Description Format/Constraints
from Sender ID name String
to Destination phone number Must start with 255 followed by 9 digits
sentSince Lower limit on sending date Y-m-d format (e.g., 2024-03-01)
sentUntil Upper limit on sending date Y-m-d format (e.g., 2024-03-15)
limit Number of records to return Integer (max 500)
offset Number of records to skip Integer
reference Message reference String

All filters are optional. You can use any combination of filters to narrow down your search.

SMS Logs Response

Register Sub-Customer (Resellers Only)

The registerSubCustomer method requires the following parameters:

Parameter Description Format/Constraints
first_name Customer's first name Required string
last_name Customer's last name Required string
username Customer's username Required string
email Customer's email address Valid email format
phone_number Customer's phone number Format: 0XXXXXXXXX or 255XXXXXXXXX
account_type Type of sub-customer account Must be either 'Sub Customer' or 'Sub Customer (Reseller)'
sms_price Price per SMS for this customer Positive number

Sub-Customer Registration Response

Note: This feature is only available for customers in the reseller program.

Response Format

All methods return an array containing the API response. Here are some example responses:

Send SMS Response

Delivery Reports Response

Balance Response

Recharge/Deduct Response

Error Handling

The package throws exceptions when API calls fail. It's recommended to wrap API calls in try-catch blocks:

Testing

The package includes comprehensive tests. To run the tests:

To generate test coverage reports:

Test Environment

For testing your application with VaraSMS, you can use the test mode by setting your base URL to the test endpoint:

Writing Tests

When writing tests for your application that uses VaraSMS, you can mock the VaraSMS facade:

License

The MIT License (MIT). Please see License File for more information.

Schedule SMS Messages

The scheduleSMS method supports both one-time and recurring message scheduling:

Required Parameters:

Parameter Description Format/Constraints
to Recipient phone number Must start with 255 followed by 9 digits
message The message to send String
date Date to send the message Y-m-d format (e.g., 2024-03-25)
time Time to send the message 24-hour format HH:mm (e.g., 14:30)

Optional Parameters:

Parameter Description Format/Constraints
senderId Custom sender ID String
recurring Array of recurring settings See below

Recurring Settings:

Setting Description Format/Constraints
repeat Frequency of repetition Must be 'hourly', 'daily', 'weekly', or 'monthly'
start_date Start date for recurring messages Y-m-d format
end_date End date for recurring messages Y-m-d format

Schedule SMS Response

Send Multiple Different Messages

The sendMultipleMessages method allows you to send different messages to different groups of recipients in a single API call:

Parameter Description Format/Constraints
messages Array of message objects Each message must contain 'to' and 'text'
reference Optional global reference String

Each message in the messages array should have:

Multiple Messages Response


All versions of varasms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package varaai/varasms contains the following files

Loading the files please wait ....