Download the PHP package shiftechafrica/shift-code-generator without Composer
On this page you can find all versions of the php package shiftechafrica/shift-code-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shiftechafrica/shift-code-generator
More information about shiftechafrica/shift-code-generator
Files in shiftechafrica/shift-code-generator
Package shift-code-generator
Short Description This package generates code in relation to year, date, and month. For instance, it uses A - Z letters for months.
License MIT
Informations about the package shift-code-generator
π Introduction
Shift Code Generator is a lightweight Laravel/PHP package that generates unique alphanumeric codes based on the year, month, and day, followed by a randomized string.
Itβs ideal for applications that require sequential or time-based identifiers β such as transaction IDs, invoice numbers, or reference codes.
For example:
1E1NKJDQVW
- 1 β Represents the number of years since the start year
- E β Represents the month (AβZ mapping)
- 1 β Represents the day of the month
- NKJDQVW β Randomly generated string
This logic mimics the behavior of M-Pesa transaction IDs, ensuring unique, traceable, and time-bound identifiers.
βοΈ Installation
Install via Composer:
Update to the latest version:
If the package isnβt automatically discovered, run:
Publish the configuration file:
This will create a config file at:
βοΈ Configuration
In your .env file, add the following:
If you enable database tracking, seed the database by adding this entry to your DatabaseSeeder:
This ensures your application initializes with proper baseline data for generating codes dynamically.
π§© Usage
Generate unique codes easily within your application.
Example Output
- 1 = Year offset
- E = Month letter
- 1 = Day
- NKJDQVW = Random string
π§ Version Guidance
| Version | Status | Packagist | Namespace | Release |
|---|---|---|---|---|
| 1.x | β Latest | shiftechafrica/shift-code-generator |
ShiftechAfrica\CodeGenerator |
v1.5.2 |
π‘οΈ Security Vulnerabilities
If you discover a security vulnerability, please contact:
π§ Bugs
π License
This package is open-source software licensed under the
MIT License
All versions of shift-code-generator with dependencies
webpatser/laravel-uuid Version ^3.0|^4.0
