PHPackages                             holla22/clickatell-otp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. holla22/clickatell-otp

ActiveLibrary

holla22/clickatell-otp
======================

Simple OTP system using Clickatell HTTP API

053CSS

Since Mar 31Pushed 11y ago1 watchersCompare

[ Source](https://github.com/holla22/clickatell-opt-example)[ Packagist](https://packagist.org/packages/holla22/clickatell-otp)[ RSS](/packages/holla22-clickatell-otp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Simple Clickatell OTP Example
=============================

[](#simple-clickatell-otp-example)

This is an simple PHP example of how to create a OTP reminder for forgotten passwords on your website.

Create a Clickatell account
===========================

[](#create-a-clickatell-account)

- Go to  and create a Developers Central -&gt; International account.
- Buy credits to be able to send out messages. You do get 10 free messages for testing but you can't change the text.
- You should have a default HTTP API created which you can access and get the API details to use in this example.

Install via Composer
====================

[](#install-via-composer)

Available on Packagist here:

add the following to your composer.json file and run composer update command

```
require: "holla22/clickatell-otp": "dev-master"

```

Usage Example
=============

[](#usage-example)

To send a sms we need to initialize our simple OTP class with our Clickatell HTTP API details

```
// send the text/sms message with OTP to the users phone

// replace the clickatell user details below with your account details.
$oMyOTP = new Otp\Otp($username, $password, $apiId);
```

Send a text message to a mobile phone number

```
// Use this to send a message to your user
$oMyOTP->sendMessage($mobileNO, $message);
```

The above is all you need to do to send out a simple text message.

Example implementation of a simple OTP system.
==============================================

[](#example-implementation-of-a-simple-otp-system)

Inside the Example folder you will have mysql folder with a SQL script to help you setup your database. It contains a user table and some example seed data.

In the example folder you will see two files myotp.php which contains the logic for the OTP system.

The login.php is the frontend website, an example of a forgot password page. On this page you can send a OTP to the mobile number of the user you've added in the user table of mysql. Just add the email of the user, click on the "Submit Email" button and it will send an sms with a random string to the users mobile number (International format without the + sign).

Take the random number you've received and enter it in the "Please provide your OTP" field and click on "Submit OTP" button. On line 108 of the myotp.php file you can add functionality to send the user it's new password.

Usage in Laravel 5
==================

[](#usage-in-laravel-5)

Simply Install laravel 5 and add the following to the composer.json file.

```
    "holla22/clickatell-otp": "dev-master",
		"curl/curl": "dev-master",
		"twbs/bootstrap": "3.3.*@dev",
		"rych/random": "1.0.*@dev",
		"guzzlehttp/guzzle": "~4.0"
```

Now run the composer update command to setup your newly added packages.

To use the clickatell OTP package in your controller simply add the following to the top of your controller file.

```
  use Otp\Otp;
  use Rych\Random\Random;
```

At this point you can start using the Class like this:

```
    // send the text/sms message with OTP to the users phone
    // replace the clickatell user details below with your account details.
    $oMyOTP = new Otp($username, $password, $apiId);

    // the message was sent to the users mobOile
    $oMyOTP->sendMessage($mobileno, $randomString );
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2de8424ce0e3e4d922a5ce28c0cff098aedf7c37d60d0e557f4804657265da80?d=identicon)[holla22](/maintainers/holla22)

---

Top Contributors

[![holla22](https://avatars.githubusercontent.com/u/4599628?v=4)](https://github.com/holla22 "holla22 (15 commits)")[![arnoesterhuizen](https://avatars.githubusercontent.com/u/49686?v=4)](https://github.com/arnoesterhuizen "arnoesterhuizen (1 commits)")

### Embed Badge

![Health badge](/badges/holla22-clickatell-otp/health.svg)

```
[![Health](https://phpackages.com/badges/holla22-clickatell-otp/health.svg)](https://phpackages.com/packages/holla22-clickatell-otp)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
