PHPackages                             floor9design/laravel-uuid-model-support - 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. [Database &amp; ORM](/categories/database)
4. /
5. floor9design/laravel-uuid-model-support

ActiveLibrary[Database &amp; ORM](/categories/database)

floor9design/laravel-uuid-model-support
=======================================

Provides traits for easy support for UUIDs in Laravel models

0.0.2(1y ago)017[4 PRs](https://github.com/floor9design-ltd/laravel-uuid-model-support/pulls)MITPHPPHP &gt;=8.2CI passing

Since Sep 21Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/floor9design-ltd/laravel-uuid-model-support)[ Packagist](https://packagist.org/packages/floor9design/laravel-uuid-model-support)[ Docs](https://github.com/floor9design-ltd/laravel-uuid-model-support)[ RSS](/packages/floor9design-laravel-uuid-model-support/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (2)Dependencies (5)Versions (26)Used By (0)

laravel-uuid-model-support
==========================

[](#laravel-uuid-model-support)

[![Latest Version](https://camo.githubusercontent.com/a837786ab67fdc34fc7f71046dfd4e93d5cdf49e50b8525bc41b2e1c7798d08e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f666c6f6f723964657369676e2d6c74642f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f696e636c7564655f70726572656c6561736573267374796c653d706c6173746963)](https://github.com/floor9design-ltd/laravel-uuid-model-support/releases)[![Packagist](https://camo.githubusercontent.com/2171267b1981e002474ecb549a91e6d7ed67723cec350d6a4b9e6b36e1183ca5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c6f6f723964657369676e2f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f7374796c653d706c6173746963)](https://packagist.org/packages/floor9design/laravel-uuid-model-support)[![Software License](https://camo.githubusercontent.com/10955426da15c7ed27f262e19d2eddeb65055494880cc858e8fc0792d5e15d1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d706c6173746963)](LICENCE.md)

[![Build Status](https://camo.githubusercontent.com/850784daee792a9c866a361ac2fe40afed07b626c0f989c508820bdb36a2fef2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f666c6f6f723964657369676e2d6c74642f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f7374796c653d706c6173746963)](https://travis-ci.com/github/floor9design-ltd/laravel-uuid-model-support)[![Code Coverage](https://camo.githubusercontent.com/0dcf61883d46273f77a1339b28e1016095534a61cf9b7f863eb0568f80269db7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f666c6f6f723964657369676e2d6c74642f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f7374796c653d706c6173746963)](https://codecov.io/gh/floor9design-ltd/laravel-uuid-model-support)

[![Github Downloads](https://camo.githubusercontent.com/f6b3a0778a4c02522e266b087b7cf8e6a1af3e6c11800f6b31bc5ca91a6af8e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f666c6f6f723964657369676e2d6c74642f6c61726176656c2d757569642d6d6f64656c2d737570706f72742f746f74616c3f7374796c653d706c6173746963)](https://github.com/floor9design-ltd/laravel-uuid-model-support)[![Packagist Downloads](https://camo.githubusercontent.com/3328e338ddd6717746e6684a1b3e7e812c034ffffaccd23766c1d3d695fdf602/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666c6f6f723964657369676e2f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f7374796c653d706c6173746963)](https://packagist.org/packages/floor9design/laravel-uuid-model-support)

A quick to implement Trait for laravel models using Ramsey\\Uuid

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

[](#introduction)

Laravel models have default behaviours associated with them that do not work "out of the box" with the excellent Ramsey\\Uuid class.

For example, `newUniqueId()` will not work as expected unless overwritten in a model. These Traits offer sensible defaults.

Features
--------

[](#features)

[![Latest Version](https://camo.githubusercontent.com/a837786ab67fdc34fc7f71046dfd4e93d5cdf49e50b8525bc41b2e1c7798d08e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f666c6f6f723964657369676e2d6c74642f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f696e636c7564655f70726572656c6561736573267374796c653d706c6173746963)](https://github.com/floor9design-ltd/laravel-uuid-model-support/releases)[![Packagist](https://camo.githubusercontent.com/2171267b1981e002474ecb549a91e6d7ed67723cec350d6a4b9e6b36e1183ca5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c6f6f723964657369676e2f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f7374796c653d706c6173746963)](https://packagist.org/packages/floor9design/laravel-uuid-model-support)

The package offers traits for UUIDs in the form of `Uuid[x]`, offering the following methods:

- `newUniqueId()`
- `uniqueIds()`

Currently supports UUIDv1 and v4 - other versions are in development.

Install
-------

[](#install)

Via Composer/packagist

[![Packagist Downloads](https://camo.githubusercontent.com/3328e338ddd6717746e6684a1b3e7e812c034ffffaccd23766c1d3d695fdf602/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666c6f6f723964657369676e2f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f7374796c653d706c6173746963)](https://packagist.org/packages/floor9design/laravel-uuid-model-support)

```
composer require floor9design/laravel-uuid-model-support
```

Via git

[![Github Downloads](https://camo.githubusercontent.com/f6b3a0778a4c02522e266b087b7cf8e6a1af3e6c11800f6b31bc5ca91a6af8e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f666c6f6f723964657369676e2d6c74642f6c61726176656c2d757569642d6d6f64656c2d737570706f72742f746f74616c3f7374796c653d706c6173746963)](https://github.com/floor9design-ltd/laravel-uuid-model-support)

```
git clone https://github.com/floor9design-ltd/laravel-uuid-model-support.git
```

Or:

```
git clone git@github.com:floor9design-ltd/laravel-uuid-model-support.git
```

Usage
-----

[](#usage)

Add a `use` statement into the model, and ensure you select the correct class.

For example, a user model might resemble:

```
namespace App\Models;

use Floor9design\LaravelUuidModelSupport\Uuid4;
// ...
class User extends Authenticatable
{
    use Uuid4;
    // ...

```

Setup
-----

[](#setup)

There are no specific config setup steps required. The class should autoload in PSR-4 compliant systems.

Testing
-------

[](#testing)

[![Build Status](https://camo.githubusercontent.com/850784daee792a9c866a361ac2fe40afed07b626c0f989c508820bdb36a2fef2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f666c6f6f723964657369676e2d6c74642f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f7374796c653d706c6173746963)](https://travis-ci.com/github/floor9design-ltd/laravel-uuid-model-support)[![Code Coverage](https://camo.githubusercontent.com/0dcf61883d46273f77a1339b28e1016095534a61cf9b7f863eb0568f80269db7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f666c6f6f723964657369676e2d6c74642f6c61726176656c2d757569642d6d6f64656c2d737570706f72743f7374796c653d706c6173746963)](https://codecov.io/gh/floor9design-ltd/laravel-uuid-model-support)

Tests can be run as follows:

- `./vendor/phpunit/phpunit/phpunit`

The following tests and also creates code coverage (usually maintained at 100%)

- `./vendor/phpunit/phpunit/phpunit --coverage-html docs/tests/`

Static analysis/code review can be performed by using [phpstan](https://phpstan.org/):

- `./vendor/bin/phpstan`

Credits
-------

[](#credits)

- [Rick](https://github.com/elb98rm)

Changelog
---------

[](#changelog)

A changelog is generated here:

- [Change log](CHANGELOG.md)

License
-------

[](#license)

This software is available under the MIT licence.

- [License File](LICENCE.md)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance70

Regular maintenance activity

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.6% 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 ~159 days

Total

2

Last Release

493d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca241b0576f1570f1de86d5cb18429e6a662cc165c1e798d321754a549d65a27?d=identicon)[elb98rm](/maintainers/elb98rm)

---

Top Contributors

[![elb98rm](https://avatars.githubusercontent.com/u/2630101?v=4)](https://github.com/elb98rm "elb98rm (113 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (106 commits)")

---

Tags

stringfloor9design

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/floor9design-laravel-uuid-model-support/health.svg)

```
[![Health](https://phpackages.com/badges/floor9design-laravel-uuid-model-support/health.svg)](https://phpackages.com/packages/floor9design-laravel-uuid-model-support)
```

###  Alternatives

[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k3.5k](/packages/leantime-leantime)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M63](/packages/knuckleswtf-scribe)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[laravel/nightwatch

The official Laravel Nightwatch package.

36210.1M36](/packages/laravel-nightwatch)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.3M19](/packages/bavix-laravel-wallet)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)

PHPackages © 2026

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