PHPackages                             fyggi/laravel-simple-uuid - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fyggi/laravel-simple-uuid

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fyggi/laravel-simple-uuid
=========================

This package adds a simple trait to add UUID to your models.

v1.0(6y ago)179MITPHPPHP ^7.4

Since Apr 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/fyggi/laravel-simple-uuid)[ Packagist](https://packagist.org/packages/fyggi/laravel-simple-uuid)[ Docs](https://github.com/fyggi/laravel-simple-uuid)[ RSS](/packages/fyggi-laravel-simple-uuid/feed)WikiDiscussions master Synced yesterday

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

Simple UUID in Laravel
======================

[](#simple-uuid-in-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f03e612b6437c6332dfda24c8d05554d4fb9d1c87d331716de6d63132116b57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66796767692f6c61726176656c2d73696d706c652d757569642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fyggi/laravel-simple-uuid)[![Total Downloads](https://camo.githubusercontent.com/6e48b997fe413c13a7232cc702870cba2ee951e6b78eab440c5dde849ebaba25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66796767692f6c61726176656c2d73696d706c652d757569642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fyggi/laravel-simple-uuid)[![Quality Score](https://camo.githubusercontent.com/82b016fd3f2f0022c9fc5dbb42dc334257224f5a428458738f289fafb1248bd9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f66796767692f6c61726176656c2d73696d706c652d757569642e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/fyggi/laravel-simple-uuid)[![StyleCI](https://camo.githubusercontent.com/e1c7bd33f428017df549fa958fbd4eed0835d49fbe9a98bccc7695c4ec56e6aa/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3235333330373837332f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/253307873)[![Treeware](https://camo.githubusercontent.com/aef9384539fd5e8ee99698a94694323f0c973fbb7c56096f65c481dac3fed691/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e3f636f6c6f723d627269676874677265656e266c6162656c3d54726565776172652671756572793d2532342e746f74616c2675726c3d68747470732533412532462532467075626c69632e6f66667365742e6561727468253246757365727325324674726565776172652532467472656573)](https://treeware.earth)

This package adds a simple trait to add UUID to your Laravel models. When using the trait, it automatically sets the route key and route key name to the UUID.

The trait also includes a scope, `whereUuid($uuid)`.

**NOTE:** The package assumes you have a field in your database called `uuid`.

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

[](#installation)

You can install the package via composer:

```
composer require fyggi/laravel-simple-uuid
```

Example
-------

[](#example)

```
