Download the PHP package mariuszmalek/unique-number-generator without Composer
On this page you can find all versions of the php package mariuszmalek/unique-number-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mariuszmalek/unique-number-generator
More information about mariuszmalek/unique-number-generator
Files in mariuszmalek/unique-number-generator
Package unique-number-generator
Short Description Easy creation of unique number for your Eloquent models in Laravel
License MIT
Homepage https://github.com/mariuszmalek/unique-number-generator
Informations about the package unique-number-generator
Unique-Number-Generator
Easy creation of unique number generator for your Eloquent models in Laravel.
NOTE: These instructions are for the latest version of Laravel.
If you are using an older version, please install a version of the package that correlates to your Laravel version.
- Installation
- Usage
- Bugs, Suggestions, Contributions and Support
- Copyright and License
Installation
Depending on your version of Laravel, you should install a different version of the package.
-
Install the package via Composer:
The package will automatically register its service provider.
- Optionally, publish the configuration file if you want to change any defaults:
Usage
Saving a model is easy:
The first parameter is $model in which we search an existing class, the second is a specific column in the database.
The next one is the prefix that will be added to the beginning of the result. The last one is the parameters for specific search classes. Only the first two parameters are required
Using traits:
You can add a Trait, so that after creating the model, a new unique number will be automatically created. You also need to add the uniqueColumn function which will contain the name of the column to be used.
Bugs, Suggestions, Contributions and Support
Please use Github for reporting bugs, and making comments or suggestions.
See CONTRIBUTING.md for how to contribute changes.
Copyright and License
unique-number-generator was written by Mariusz Malek and is released under the MIT License.
Copyright (c) 2021 Mariusz Malek
All versions of unique-number-generator with dependencies
illuminate/config Version ^8.0
illuminate/database Version ^8.0
illuminate/support Version ^8.0