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.2.0(2w ago)0150MITPHPPHP ^8.2

Since Mar 17Pushed 3mo 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 2d ago

READMEChangelog (3)Dependencies (12)Versions (5)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

41

—

FairBetter than 87% of packages

Maintenance86

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Total

4

Last Release

19d 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

[spatie/laravel-permission

Permission handling for Laravel 12 and up

13.0k107.5M1.6k](/packages/spatie-laravel-permission)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M293](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-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.

45844.8k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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