Download the PHP package justbetter/laravel-unique-values without Composer
On this page you can find all versions of the php package justbetter/laravel-unique-values. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download justbetter/laravel-unique-values
More information about justbetter/laravel-unique-values
Files in justbetter/laravel-unique-values
Package laravel-unique-values
Short Description Package to generate unique values with support for concurrency utilizing cache locking
License
Informations about the package laravel-unique-values
Package to generate unique values
This package generates persistent unique values with support for concurrency utilizing scoped cache locking. It stores generated unique values in the database.
Generated values are unique per scope and can be generated using a callback method. This package only supports strings.
Features
- Generate unique values
- Support for concurrency
- Customizable generator
- Maximum attempts
- Support for subjects
Installation
You can install the package via composer:
Usage
Output after first run: unique-value
.
Output after second run: unique-value-1
.
Output after third run: unique-value-2
.
Maximum attempts
You can configure the maximum attempts, this is three by default. If the maximum attempts are reached an exception is thrown.
Subject
You can add a subject to retrieve a previously generated value for the subject. Optionally you can add an override flag to run the generation again for the subject.
First run will output: unique-value
.
Second run will output: unique-value
.
Only one unique value will be stored in the database.
Quality
To ensure the quality of this package, run the following command:
This will execute three tasks:
- Makes sure all tests are passed
- Checks for any issues using static code analysis
- Checks if the code is correctly formatted
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Vincent Boon
- Ramon Rietdijk
- All Contributors
License
The MIT License (MIT). Please see License File for more information.