New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

continuum-digital/uid

Laravel package to generate unique identifiers
1,921
Install
composer require continuum-digital/uid
Latest Version:0.0.1
PHP:^7.1
Laravel:5
License:MIT
Last Updated:Aug 23, 2018
Links: GitHub  ·  Packagist
Maintainer: davidianbonner

Continuum Agency Uid

Laravel package to create automatic unique nullable identifiers like u5CVsCnxyXg for your Eloquent models.

Installation

Require this package

composer require continuum-digital/uid

Usage

Configuration

Create a new entry in database.config.php to configure your uid's:

    'uid' => [
        'salt' => '', // Default ''
        'minLength' => '', // Default 0
        'alphabet' => '', // Default 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
    ],

You can remove the salt, minLength or alphabet to use default values.

Database

Add the $table->uid() in your Schemas:

Schema::create('your_table', function (Blueprint $table) {
    $table->uid();
})

Eloquent

Add the HasUid trait to your Models to add the capabilities:

  • Local scope $model->uid($uid)
  • Automatic generation of uid during the creating event

Notes

This package use HashIds under the hood.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

651,963,193 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

518,004,183 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

435,097,283 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
0.0.1 ^7.1 >=5.5 MIT