PHPackages                             ddlabs/uuid-package - 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. ddlabs/uuid-package

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

ddlabs/uuid-package
===================

Package to allow you to use UUID for primary key in Laravel Models

2(4y ago)06.7k2MITPHPPHP ^7.0|^8.0

Since Mar 6Pushed 4y ago2 watchersCompare

[ Source](https://github.com/DiegoLabs/uuid-package)[ Packagist](https://packagist.org/packages/ddlabs/uuid-package)[ RSS](/packages/ddlabs-uuid-package/feed)WikiDiscussions master Synced 1mo ago

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

[![DiegoDev Labs](https://camo.githubusercontent.com/e285cfa59b6ff82fd31c1d1927cb8a1b9ab4e161587f7a164ba417c1cac77642/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f3366756679627464687275366d68622f446965676f4c6162732532304c6f676f2e706e67)](https://camo.githubusercontent.com/e285cfa59b6ff82fd31c1d1927cb8a1b9ab4e161587f7a164ba417c1cac77642/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f3366756679627464687275366d68622f446965676f4c6162732532304c6f676f2e706e67)

DiegoLabs UUID Package
======================

[](#diegolabs-uuid-package)

Simple package to allow you to add UUID to Laravel Models via a trait.

Install
-------

[](#install)

```
 composer require ddlabs/uuid-package

```

Traits
------

[](#traits)

- **SetsUuidWhenCreating** - This sets the primary key of the model to a UUID. It allows you to pass a UUID if you have a workflow that creates a UUID by default. If the UUID is version 4 compliant, then the trait will just us the UUID passed to it. We use this from time to time when records are created on a mobile device then passed to a backend via an API. They may already have a UUID associated with it.

Usage
-----

[](#usage)

ID must be configured in the database to accept a UUID.

For Migrations:

```
public function up()
{
    Schema::create('your_models', function (Blueprint $table) {
        $table->uuid('id'); // Set to uuid
        $table->string('name');
        $table->timestamps();
        $table->primary('id'); // Add primary key
    });
}

```

For Models:

```
use Ddlabs\Uuid\Traits\SetsUuidWhenCreating;

class YourModel extends Model
{
    use SetsUuidWhenCreating;

    public $incrementing = false;

    protected $keyType = 'string';
   ...
}

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~157 days

Total

4

Last Release

1791d ago

PHP version history (2 changes)v1.0PHP ^7.1.3

2PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/27b4fafc357732ddf8df7c17ac34bc5eb0d7b22bce02d5f065e060c71adb32c5?d=identicon)[Eric Van Johnson](/maintainers/Eric%20Van%20Johnson)

---

Top Contributors

[![ericvanjohnson](https://avatars.githubusercontent.com/u/89408?v=4)](https://github.com/ericvanjohnson "ericvanjohnson (21 commits)")[![rettigd](https://avatars.githubusercontent.com/u/875977?v=4)](https://github.com/rettigd "rettigd (3 commits)")

### Embed Badge

![Health badge](/badges/ddlabs-uuid-package/health.svg)

```
[![Health](https://phpackages.com/badges/ddlabs-uuid-package/health.svg)](https://phpackages.com/packages/ddlabs-uuid-package)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)[hipsterjazzbo/landlord

A simple, single database multi-tenancy solution for Laravel 5.2+

613270.0k1](/packages/hipsterjazzbo-landlord)[stancl/virtualcolumn

Eloquent virtual column.

826.8M13](/packages/stancl-virtualcolumn)

PHPackages © 2026

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