PHPackages                             frictionlessdigital/uuidable - 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. frictionlessdigital/uuidable

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

frictionlessdigital/uuidable
============================

Frictionless Solutions | Uuidable

12.0.0(1y ago)0325MITPHPPHP ^8.1

Since Jul 26Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Frictionlessdigital/uuidable)[ Packagist](https://packagist.org/packages/frictionlessdigital/uuidable)[ RSS](/packages/frictionlessdigital-uuidable/feed)WikiDiscussions v1.x Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (11)Used By (0)

FLS :: Uuidable
===============

[](#fls--uuidable)

Add [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) behavior to your Eloquent models.

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

[](#installation)

```
composer require "frictionlessdigital/uuidable":"^1.0"
```

**Note that root namespace for the package is `Fls` not `Frictionlessditial`.**

### Config

[](#config)

The package does not require configuration.

Integration
-----------

[](#integration)

To add behavior to your model, simply import the trait:

```
use Fls\Uuidable\Uuidable;

class User extends Model
{
    use Uuidable;
    ...
}
```

If you want to update the field to within which the UUID is stored, define a static model propery like so:

```
use Fls\Uuidable\Uuidable;

class User extends Model
{
    use Uuidable;
    ...

    /**
     * Name of the field to to store the UUID
     *
     * @var string
     */
    const UUID = 'diuu';
}
```

Usage
-----

[](#usage)

`Fls\Uuidable\Uuidable` trait adds a number of methods to your model:

### Uuidable::findByUuid

[](#uuidablefindbyuuid)

Similar to `find($key)`, `findByUuid($uuid)` will locate the first Uuidable model where the value of the fild matches the argument.

```
$user  = User::findByUuid(string $uuid);
```

You can also pass an array of column you want to hydrate from the database as a second argument:

```
$user  = User::findByUuid(string $uuid, ['email', 'password']);
```

Under the hood the method relies on `whereUuid()`

### Uuidable::whereUuid()

[](#uuidablewhereuuid)

Scope the model by uuid value. You can use a string value, an array, pass in Arrayable class. **N.B.** *if you pass an Eloquent Collection, it will be parsed for its model keys, which will be passed as a scoping argument.*

```
$builder  = User::whereUuid(string $uuid);
```

or

```
$builder  = User::whereUuid([$uuid]);
```

or

```
$builder  = User::whereUuid(collect([$uuid]));
```

or

```
$builder  = User::whereUuid(Users::pluck('uuid'));
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Cyrill N Kalita](https://github.com/nickfls)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---

[![](./resources/docs/gramma.png)](http://frictionlesssolutions.com "Fricitonless Solutions Inc.")

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance42

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~134 days

Recently: every ~183 days

Total

11

Last Release

411d ago

Major Versions

1.3.0 → 12.0.02024-10-17

v1.x-dev → v12.x-dev2025-04-02

PHP version history (2 changes)1.0.0PHP ^7.3 || ^8.0

1.3.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6897fa24df64545b665dc9b4707e5f69d766ab4d2a1b5b13041e22d7eb8b30d?d=identicon)[cyrill@frictionlesssolutions.com](/maintainers/cyrill@frictionlesssolutions.com)

---

Top Contributors

[![nickfls](https://avatars.githubusercontent.com/u/12013206?v=4)](https://github.com/nickfls "nickfls (20 commits)")

---

Tags

laravelfls

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/frictionlessdigital-uuidable/health.svg)

```
[![Health](https://phpackages.com/badges/frictionlessdigital-uuidable/health.svg)](https://phpackages.com/packages/frictionlessdigital-uuidable)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
