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

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

maarheeze/uuid-laravel
======================

laravel integration for a simple uuid value object

1.1.0(3mo ago)0101MITPHPPHP ^8.2

Since Mar 17Pushed 2mo agoCompare

[ Source](https://github.com/maarheeze/uuid-laravel)[ Packagist](https://packagist.org/packages/maarheeze/uuid-laravel)[ RSS](/packages/maarheeze-uuid-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

maarheeze/uuid-laravel
======================

[](#maarheezeuuid-laravel)

Laravel integration for [maarheeze/uuid](https://github.com/maarheeze/uuid). Provides an Eloquent cast and a trait for using uuid's as primary keys.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 8–12

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

[](#installation)

```
composer require maarheeze/uuid-laravel
```

Usage
-----

[](#usage)

### Using UUID as primary key

[](#using-uuid-as-primary-key)

Add the `HasUuidAsId` trait to an Eloquent model, a uuid is automatically generated on creation.

```
use Illuminate\Database\Eloquent\Model;
use Maarheeze\CalendarDate\Laravel\Model\Concerns\HasUuidAsId;

class Article extends Model
{
    use HasUuidAsId;
}
```

```
$article = Article::create(['title' => 'Hello world']);

$article->getKey(); // returns a UuidInterface instance
```

### Casting a UUID column

[](#casting-a-uuid-column)

Use `UuidCast` directly on any model attribute to cast it to a `UuidInterface`.

```
use Illuminate\Database\Eloquent\Model;
use Maarheeze\CalendarDate\Laravel\Model\Casts\UuidCast;

class Article extends Model
{
    protected $casts = [
        'related_id' => UuidCast::class,
    ];
}
```

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance84

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

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

Every ~1 days

Total

3

Last Release

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/734972e64c460b2142b0b04b4f40aa30077c5dd1915411b486ec72efcae3c3bf?d=identicon)[wietsewarendorff](/maintainers/wietsewarendorff)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58122.8k](/packages/laracraft-tech-laravel-useful-additions)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

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