PHPackages                             angle/keyable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. angle/keyable

ActiveLibrary

angle/keyable
=============

Add random unique keys to any model in a Laravel application.

v1.0(7y ago)13MITPHP

Since Feb 3Pushed 7y agoCompare

[ Source](https://github.com/anglesoft/keyable)[ Packagist](https://packagist.org/packages/angle/keyable)[ RSS](/packages/angle-keyable/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

🗝 Keyable Models in Laravel
===========================

[](#-keyable-models-in-laravel)

Introduction
------------

[](#introduction)

Many web applications require unique references to their data. Sometimes, increments and uuids are not enough for specific use-cases. Keyable attempts to solve this problem by providing methods that are automatically called on your models, via a trait.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1
- Laravel &gt;= 5.6
- Relational Database (not tested with other drivers)

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require angle/keyable

```

Using the Keyable Trait
-----------------------

[](#using-the-keyable-trait)

Granted the Model is using `Angle\Keyable\Keyable`, unique keys are automatically generated upon the `creating()` [Eloquent Model Event](https://laravel.com/docs/5.7/eloquent#events).

```
