itcrackers / helper
Common utility package for Core PHP and PHP frameworks, providing masking, validation, and formatting helpers.
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^10.0
README
A lightweight, framework-independent PHP utility package that provides Masking, Validation, and Formatting helpers for Core PHP and modern PHP frameworks such as Laravel.
๐ Table of Contents
- Features
- Requirements
- Compatibility
- Installation
- Available Modules
- Quick Start
- Usage
- Examples
- Testing
- Project Structure
- Versioning
- Changelog
- Contributing
- Security
- Support
- License
- Author
โจ Features
- Framework Independent
- Supports Core PHP
- Supports Laravel
- PSR-4 Autoloading
- Lightweight
- High Performance
- Easy Integration
- Zero Configuration
- Clean API
- Production Ready
- Composer Installable
- Fully Object-Oriented
โ๏ธ System Requirements
| Software | Minimum Version |
|---|---|
| PHP | 7.0+ |
| Composer | 2.4+ |
๐ Compatibility
| Platform | Support |
|---|---|
| Core PHP | โ |
| Laravel 8โ13 | โ |
| Symfony | โ |
| CodeIgniter | โ |
| CakePHP | โ |
| Slim Framework | โ |
| Yii Framework | โ |
๐ฆ Installation
Install the package via Composer.
composer require itcrackers/helper
๐ Quick Start
Core PHP
<?php require 'vendor/autoload.php'; use ITCrackers\Helper\Masking; echo Masking::email('john@example.com');
Laravel
use ITCrackers\Helper\Masking; echo Masking::email('john@example.com');
๐ Available Modules
๐ Masking
Hide sensitive information before displaying it.
| Method | Description |
|---|---|
| email() | Mask Email Address |
| phone() | Mask Mobile Number |
| aadhaar() | Mask Aadhaar Number |
| pan() | Mask PAN Number |
| passport() | Mask Passport Number |
| account() | Mask Bank Account Number |
| card() | Mask Credit/Debit Card Number |
โ Validation
Validate commonly used data formats.
| Method | Description |
|---|---|
| email() | Validate Email Address |
| phone() | Validate Mobile Number |
| aadhaar() | Validate Aadhaar Number |
| pan() | Validate PAN Number |
| ifsc() | Validate IFSC Code |
| gstin() | Validate GSTIN |
| passport() | Validate Passport Number |
| pincode() | Validate PIN Code |
| url() | Validate URL |
| ip() | Validate IP Address |
| ipv4() | Validate IPv4 Address |
| ipv6() | Validate IPv6 Address |
| uuid() | Validate UUID |
| macAddress() | Validate MAC Address |
| password() | Validate Password Strength |
| creditCard() | Validate Credit Card |
| upi() | Validate UPI ID |
| vehicleNumber() | Validate Vehicle Registration Number |
๐ป Usage
Core PHP
<?php require 'vendor/autoload.php'; use ITCrackers\Helper\Masking; use ITCrackers\Helper\Validation; echo Masking::email('john@example.com'); echo Masking::phone('8619844326'); Validation::email('john@example.com'); Validation::phone('8619844326');
Laravel
<?php use ITCrackers\Helper\Masking; use ITCrackers\Helper\Validation; Masking::aadhaar('123412341234'); Validation::aadhaar('123412341234');
๐ Examples
Email Masking
Masking::email('john@example.com');
Output
jo***@example.com
Phone Masking
Masking::phone('8619844326');
Output
86******26
Aadhaar Masking
Masking::aadhaar('123412341234');
Output
XXXXXXXX1234
PAN Masking
Masking::pan('ABCDE1234F');
Output
ABCXXXXXXF
Email Validation
Validation::email('john@example.com');
Output
true
Phone Validation
Validation::phone('8619844326');
Output
true
Aadhaar Validation
Validation::aadhaar('123412341234');
Output
true
PAN Validation
Validation::pan('ABCDE1234F');
Output
true
๐งช Running Tests
Run PHPUnit tests.
vendor/bin/phpunit
๐ Project Structure
itcrackers-helper/
โ
โโโ src/
โ โโโ Masking.php
โ โโโ Validation.php
โ โโโ ...
โ
โโโ tests/
โ
โโโ composer.json
โโโ phpunit.xml
โโโ README.md
โโโ CHANGELOG.md
โโโ CONTRIBUTING.md
โโโ LICENSE
โโโ .gitignore
๐ Versioning
This project follows Semantic Versioning (SemVer).
| Version | Description |
|---|---|
| Major (X.0.0) | Breaking Changes |
| Minor (1.X.0) | New Features |
| Patch (1.0.X) | Bug Fixes |
Example
v1.0.0
v1.1.0
v1.1.1
๐ Changelog
See the CHANGELOG.md file for complete release history.
๐ค Contributing
Contributions are always welcome.
Development Workflow
git clone https://github.com/ITCrackers/helper.git
cd helper
composer install
Create a feature branch.
git checkout -b feature/new-feature
Commit your changes.
git commit -m "Add new feature"
Push your branch.
git push origin feature/new-feature
Finally, create a Pull Request.
๐ Security
If you discover any security vulnerability, please create a private issue or contact the maintainer before publicly disclosing it.
โญ Support
If you find this package useful, please consider:
- โญ Starring the repository on GitHub
- ๐ Reporting bugs
- ๐ก Suggesting new features
- ๐ค Contributing to the project
๐ License
This package is open-sourced software licensed under the MIT License.
See the LICENSE file for more information.
๐จโ๐ป Author
ITCrackers
GitHub
Packagist
https://packagist.org/packages/itcrackers/helper