Download the PHP package fanmade/laravel-nanoid without Composer
On this page you can find all versions of the php package fanmade/laravel-nanoid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download fanmade/laravel-nanoid
More information about fanmade/laravel-nanoid
Files in fanmade/laravel-nanoid
Download fanmade/laravel-nanoid
More information about fanmade/laravel-nanoid
Files in fanmade/laravel-nanoid
Vendor fanmade
Package laravel-nanoid
Short Description A small package to add Nano IDs to Laravel
License MIT
Package laravel-nanoid
Short Description A small package to add Nano IDs to Laravel
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-nanoid
Laravel Nano ID
Introduction
A simple package to generate Nano IDs in Laravel.
What is a Nano ID?
A Nano ID is a URL-friendly, unique string ID.
It is similar to UUIDs, but shorter and more readable.
Nano IDs are 21 characters long by default and can be customized to be longer or shorter.
- Read more on Medium: Nano ID: A Tiny, Secure URL-friendly Unique String ID Generator
- Or on GitHub: Nano ID
Table of Contents
- Features
- Requirements
- Installation
- Usage
- Configuration
- Testing
- Alternatives (and inspirations)
Features
- A facade to generate Nano IDs
- A helper function to use as alternative to the facade
- Configuration options to customize the defaults for your Nano IDs
- Prefix
- Suffix
- Alphabet
- Size
- Random string generator
- More to come
- Easily extensible with custom validation rules (like uniqueness or swear word checks)
Requirements
- PHP >= 8.0
Installation
Usage
Configuration
Publish the configuration file
Option | Description | Default |
---|---|---|
prefix |
An optional prefix which will be added to the Nano ID | '' |
suffix |
An optional suffix which will be added to the Nano ID | '' |
alphabet |
The alphabet to use for generating the Nano ID | 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_ +abcdefghijklmnopqrstuvwxyz- |
size |
The default size/length of the Nano ID | 21 |
generator |
The generator class to use for generating random strings | \Fanmade\NanoId\Generator\HidehaloStringGenerator |
include_prefix_in_length |
Controls if the prefix is included or excluded in the size limitation | true |
include_suffix_in_length |
Controls if the suffix is included or excluded in the size limitation | true |
Testing
or
Alternatives (and inspirations)
- hidehalo/nanoid-php - The original Nano ID package for PHP. This is also used in the background of this package.
- yondifon/laravel-nanoid - More focused on adding the Nano IDs to the models.
- ttbooking/laravel-nanoid - This one has more focus on extending the string helpers.
All versions of laravel-nanoid with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package fanmade/laravel-nanoid contains the following files
Loading the files please wait ....