Download the PHP package gordonsarah/tz-phone without Composer

On this page you can find all versions of the php package gordonsarah/tz-phone. 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 tz-phone

Tanzania Phone Validator

Tests Latest Version on Packagist Total Downloads

A PHP package (with optional Laravel extras) that validates, normalizes, and identifies Tanzanian mobile numbers using the TCRA National Numbering Plan.

Sponsored by TechMorah.

Features

It maps the prefix to the original network:

Operator Company Mobile money Prefixes Status
Vodacom Vodacom Tanzania PLC M-Pesa 074, 075, 076, 079 operational
Airtel Airtel Tanzania PLC Airtel Money 068, 069, 078 operational
Yas (Tigo / Mixx) Honora Tanzania PLC Mixx by Yas 065, 067, 071, 077 operational (077 former Zantel)
Halotel Viettel Tanzania PLC HaloPesa 061, 062 062 not operational
TTCL Tanzania Telecommunications Corporation T-Pesa 073 operational
Smile Smile Communications Tanzania Limited — 066 reserved (still circulating)
Amotel Mkulima African Telecommunication Company Limited — 063 reserved
CooTel Wiafrica Tanzania Limited — 064 reserved
MO Mobile MO Mobile Holding Limited — 072 reserved

070 is reserved by TCRA and is not assigned until you add it in the database. Prefixes live in data (config or database), not hardcoded if statements.

PHP packages are published on Packagist, not pub.dev. pub.dev is the registry for Dart/Flutter.

Installation

Laravel 10+ will auto-discover the service provider. Then create the prefix tables and seed TCRA defaults:

After that, prefixes are read from the database. Adding a new TCRA code is a row change, not a code change.

Usage

Accepted input shapes:

Helper:

Identify Mixx by Yas, Vodacom, Airtel, Halotel, TTCL

Manage prefixes from the database

Laravel uses your app database (MySQL, PostgreSQL, or SQLite). Tables:

Artisan:

Eloquent (Filament, Nova, or your own admin):

Plain PHP with SQLite (no Laravel):

Laravel validation

String rule (after the service provider is loaded):

Facade:

Bootstrap demo

Open http://127.0.0.1:8080 to try numbers against the live registry.

Caveats

Testing

Changelog

Please see CHANGELOG.

Security

Please review SECURITY for how to report vulnerabilities.

Credits

License

The MIT License (MIT). Please see LICENSE.


All versions of tz-phone with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 gordonsarah/tz-phone contains the following files

Loading the files please wait ...