Download the PHP package eg-mohamed/referenceable without Composer
On this page you can find all versions of the php package eg-mohamed/referenceable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eg-mohamed/referenceable
More information about eg-mohamed/referenceable
Files in eg-mohamed/referenceable
Package referenceable
Short Description Advanced Laravel package for generating customizable model reference numbers with flexible formats, sequential numbering, and comprehensive configuration options
License MIT
Homepage https://github.com/eg-mohamed/referenceable
Informations about the package referenceable
Referenceable
An advanced Laravel package for making models referenceable with customizable reference numbers, flexible formats, sequential numbering, template-based generation, and comprehensive configuration options.
โจ Features
- Multiple Generation Strategies: Random, sequential, and template-based reference generation
- Highly Configurable: Extensive configuration options for prefixes, suffixes, separators, and more
- Template System: Use placeholders like
{YEAR}
,{MONTH}
,{SEQ}
,{RANDOM}
for complex formats - Sequential Numbering: Auto-incrementing sequences with reset options (daily, monthly, yearly)
- Validation & Verification: Built-in reference validation and uniqueness checking
- Collision Handling: Automatic collision detection and resolution
- Multi-Tenancy Support: Tenant-aware reference generation
- Artisan Commands: Comprehensive CLI tools for management and maintenance
- Performance Optimized: Caching, batch processing, and database transactions
- Laravel 12 Ready: Full compatibility with the latest Laravel versions
๐ Installation
Install the package via Composer:
Install the package (creates necessary tables and publishes config):
๐ Quick Start
1. Add Reference Column to Migration
2. Use the Trait in Your Model
3. Generate References Automatically
๐ Configuration
Generation Strategies
Choose from three powerful generation strategies:
Random Strategy (Default)
Sequential Strategy
Template Strategy
Available Template Placeholders
Placeholder | Description | Example |
---|---|---|
{PREFIX} |
Custom prefix | ORD |
{SUFFIX} |
Custom suffix | 2024 |
{YEAR} |
4-digit year | 2024 |
{YEAR2} |
2-digit year | 24 |
{MONTH} |
2-digit month | 03 |
{DAY} |
2-digit day | 15 |
{SEQ} |
Sequential number | 0001 |
{RANDOM} |
Random string | AB12 |
{MODEL} |
Model class name | Order |
{TIMESTAMP} |
Unix timestamp | 1640995200 |
Model-Level Configuration
Global Configuration
Configure defaults in config/referenceable.php
:
๐ง Advanced Usage
Manual Reference Generation
Reference Validation
Query Scopes
Batch Operations
๐ฏ Artisan Commands
Installation & Setup
Reference Management
Package Information
๐ Multi-Tenancy Support
For multi-tenant applications:
โก Performance Optimization
Database Indexes
Configuration Caching
๐ Migration Guide
From v1.x to v2.x
-
Run the installation command:
-
Update your models to use new configuration format:
- Test your references:
๐งช Testing
๐ Changelog
Please see CHANGELOG for more information on what has changed recently.
๐ค Contributing
Please see CONTRIBUTING for details.
๐ Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
๐ Credits
- Mohamed Said
- All Contributors
๐ License
The MIT License (MIT). Please see License File for more information.
All versions of referenceable with dependencies
spatie/laravel-package-tools Version ^1.92.7
illuminate/contracts Version ^10.0||^11.0||^12.0