Download the PHP package james322/has-nano-id-laravel without Composer
On this page you can find all versions of the php package james322/has-nano-id-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download james322/has-nano-id-laravel
More information about james322/has-nano-id-laravel
Files in james322/has-nano-id-laravel
Package has-nano-id-laravel
Short Description A php trait to add nano id to laravel models.
License MIT
Homepage https://github.com/james322/has-nano-id-laravel
Informations about the package has-nano-id-laravel
This is my package has-nano-id-laravel
A php trait to add Nano IDs to Laravel models.
Installation
You can install the package via composer:
Publish the config file with:
This is the contents of the published config file:
Usage
In your model import the trait and add the column to your database table you wish to use for the Nano ID.
Now when the model is created for the first time a Nano ID will be generated.
The database column used for storing the Nano ID can be customized by adding a $nano_id_key property on your model.
The default alphabet and size (length) of the nano id can be customized in the nano-id.php config file. You can also customize it on a per model basis by adding $nano_id_alphabet and $nano_id_size property to your model.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of has-nano-id-laravel with dependencies
hidehalo/nanoid-php Version ^2.0
illuminate/contracts Version ^10.0||^11.0
spatie/laravel-package-tools Version ^1.16