PHPackages                             stevenmaguire/laravel-uuid-model - 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. stevenmaguire/laravel-uuid-model

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

stevenmaguire/laravel-uuid-model
================================

Create non-incrementing Laravel models whose primary key is a UUID

0.1.0(10y ago)446MITPHPPHP &gt;=5.5.0

Since Oct 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/stevenmaguire/laravel-uuid-model)[ Packagist](https://packagist.org/packages/stevenmaguire/laravel-uuid-model)[ Docs](https://github.com/stevenmaguire/laravel-uuid-model)[ RSS](/packages/stevenmaguire-laravel-uuid-model/feed)WikiDiscussions master Synced 1mo ago

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

Laravel Uuid Model
==================

[](#laravel-uuid-model)

[![Latest Version](https://camo.githubusercontent.com/24a0e06ce311e98897c9dc7319ce356f28eacc86e1b0a9a2049b2a19e8490f94/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73746576656e6d6167756972652f6c61726176656c2d757569642d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/stevenmaguire/laravel-uuid-model/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/7f190185732d890caef8c97a0a79ca67e636e107aa04b8f0fa798d40ce0fcf1a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73746576656e6d6167756972652f6c61726176656c2d757569642d6d6f64656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/stevenmaguire/laravel-uuid-model)[![Coverage Status](https://camo.githubusercontent.com/78321c7eef90c6f15a7ed2173f3b9e2bfba58d7bd28174b4d5c80d3acfd777af/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f73746576656e6d6167756972652f6c61726176656c2d757569642d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/stevenmaguire/laravel-uuid-model/code-structure)[![Quality Score](https://camo.githubusercontent.com/3d25d4f6c3f55f1e08780495f6c013b01e2c16216d4f1dcc0b40564c49e70d76/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73746576656e6d6167756972652f6c61726176656c2d757569642d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/stevenmaguire/laravel-uuid-model)[![Total Downloads](https://camo.githubusercontent.com/3ad0ea9e927c1afdc9d0a9c86baf7a24a4dbfc077f64a0f4a11b3dda0a7a23d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746576656e6d6167756972652f6c61726176656c2d757569642d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stevenmaguire/laravel-uuid-model)

Create non-incrementing models whose primary key is a UUID.

Install
-------

[](#install)

Via Composer

```
$ composer require stevenmaguire/laravel-uuid-model
```

Usage
-----

[](#usage)

### Extend the `UuidModel`

[](#extend-the-uuidmodel)

```
class User extends Stevenmaguire\Laravel\UuidModel
{
    //
}
```

By default any model that extends the `UuidModel` will automatically assign a random UUID value to the `primaryKey` while `creating`.

To include custom "UUID attributes", each model that extends the `UuidModel` can declare those attributes as an array value for the `uuidAttributes` property.

```
class User extends Stevenmaguire\Laravel\UuidModel
{
    /**
     * Auto-assigned uuid model attributes.
     *
     * @var array
     */
    public $uuidAttributes = ['foo', 'bar'];
}
```

This will result in the model's primary key, `id`, `foo`, and `bar` all being automatically assigned a random UUID value.

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Steven Maguire](https://github.com/stevenmaguire)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3862d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d9c05a30823ae19fc54aa4b4721a696c253f8dec10c7fd22d372cfdc0fcb36d?d=identicon)[stevenmaguire](/maintainers/stevenmaguire)

---

Top Contributors

[![stevenmaguire](https://avatars.githubusercontent.com/u/1851973?v=4)](https://github.com/stevenmaguire "stevenmaguire (2 commits)")

---

Tags

laravelormmodeleloquentuuidguidstevenmaguire

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[ymigval/laravel-model-cache

Laravel package for caching Eloquent model queries

7642.2k3](/packages/ymigval-laravel-model-cache)[sebastiaanluca/laravel-boolean-dates

Automatically convert Eloquent model boolean attributes to dates (and back).

40111.7k1](/packages/sebastiaanluca-laravel-boolean-dates)[mvanduijker/laravel-model-exists-rule

Validation rule to check if a model exists

22194.5k1](/packages/mvanduijker-laravel-model-exists-rule)[matchory/elasticsearch

The missing elasticsearch ORM for Laravel!

3059.0k](/packages/matchory-elasticsearch)

PHPackages © 2026

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