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

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

macsidigital/laravel-uuid
=========================

Laravel UUID package

5.0.1(1y ago)22.8kMITPHPPHP ^8.1|^8.2|^8.3|^8.4CI failing

Since Dec 13Pushed 1y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (13)Used By (0)

Laravel UUID
============

[](#laravel-uuid)

UUID's on Laravel models
------------------------

[](#uuids-on-laravel-models)

[![Header Image](https://github.com/MacsiDigital/repo-design/raw/master/laravel-uuid/header.png)](https://github.com/MacsiDigital/repo-design/raw/master/laravel-uuid/header.png)

 [![tests badge](https://github.com/MacsiDigital/laravel-uuid/workflows/Tests/badge.svg)](https://github.com/MacsiDigital/laravel-uuid/actions?query=workflow%3ATests) [![version badge](https://camo.githubusercontent.com/bb86c80a7dff819c9819d9f9a988e86b7a1ac833df5a3a48e417b8a2049d2637/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616373696469676974616c2f6c61726176656c2d757569642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/macsidigital/laravel-uuid) [![downloads badge](https://camo.githubusercontent.com/4b08d7126b15f6c726feff33c7883d64750182ad41a1af96ac760a7d604d428c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616373696469676974616c2f6c61726176656c2d757569642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/macsidigital/laravel-uuid)

Laravel UUID, a UUID helper Library

Support us
----------

[](#support-us)

We invest a lot in creating [open source packages](https://macsidigital.co.uk/open-source), and would be grateful for a [sponsor](https://github.com/sponsors/MacsiDigital) if you make money from your product that uses them.

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

[](#installation)

This package can be used in Laravel 10.0 or higher with PHP 8.0 and higher. There are older versions which go back to PHP7.4 and Laravel 6.

You can install the package via composer:

```
composer require macsidigital/laravel-uuid
```

Usage
-----

[](#usage)

This is quite a simple package, which can be used to override the primary key to uuid, or to add an additional uuid field, our preferred option to keep an incrementing index.

Add a uuid field

```
	// primary key implementation
    $table->uuid('id')->primary();

    // or implementation for additional field

    $table->uuid('uuid');

});
```

Add the trait to get automatic UUID generation

```
namespace App\Models;
use Uuid\Traits\GeneratesUuid;

class FakeModel extends Model
{

use GeneratesUuid;

}
```

That's it! unless we use a different column name for the uuid field, then we add the following method.

```
	 public function uuidColumn(): string
    {
        return 'id';
    }
});
```

Changelog
---------

[](#changelog)

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

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)

- [Colin Hall](https://github.com/colinhall17)
- [MacsiDigital](https://github.com/MacsiDigital)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance44

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 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 ~172 days

Recently: every ~278 days

Total

12

Last Release

443d ago

Major Versions

1.1.0 → 2.0.02021-04-25

2.0.0 → 3.0.02022-02-08

3.1.0 → 4.0.02024-05-11

4.0.0 → 5.0.02025-02-24

PHP version history (5 changes)1.0.0PHP ^7.3

2.0.0PHP ^7.4|^8.0

3.0.0PHP ^7.4|^8.0|^9.0

3.1.0PHP ^8.1

4.0.0PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/134dcd0c87f691d2f351f4bff03eb390871de1992f1a79ecf034b4ac53b4ca71?d=identicon)[MacsiDigital](/maintainers/MacsiDigital)

---

Top Contributors

[![colinhall17](https://avatars.githubusercontent.com/u/5073205?v=4)](https://github.com/colinhall17 "colinhall17 (28 commits)")

---

Tags

hacktoberfestlaraveluuidmacsidigitallaravel-uuid

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)[webpatser/laravel-uuid

Laravel integration for webpatser/uuid - High-performance drop-in UUID replacements (15% faster than Ramsey). Provides Str macros, HasUuids trait, facades, and casts. RFC 4122/9562 compliant.

1.8k17.3M129](/packages/webpatser-laravel-uuid)[emadadly/laravel-uuid

laravel uuid a simple, automatic UUID generator for any model based on Laravel.

120415.9k3](/packages/emadadly-laravel-uuid)[madewithlove/laravel-nova-uuid-support

Adds uuid and other string identifier support to Laravel Nova

28132.9k](/packages/madewithlove-laravel-nova-uuid-support)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

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

PHPackages © 2026

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