PHPackages                             hpolthof/laravel-eloquent-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. [Database &amp; ORM](/categories/database)
4. /
5. hpolthof/laravel-eloquent-uuid

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

hpolthof/laravel-eloquent-uuid
==============================

Add support for UUIDs to Eloquent

v1.0.3(6y ago)07PHP

Since Aug 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/hpolthof/laravel-eloquent-uuid)[ Packagist](https://packagist.org/packages/hpolthof/laravel-eloquent-uuid)[ RSS](/packages/hpolthof-laravel-eloquent-uuid/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (4)Used By (0)

Laravel Eloquent UUID
=====================

[](#laravel-eloquent-uuid)

Allow the usage of UUID in a MySQL setup.

How to install?
---------------

[](#how-to-install)

Install the repository with composer

```
composer require hpolthof/laravel-eloquent-uuid
```

Laravel should auto-discover the required service providers.

How to use?
-----------

[](#how-to-use)

The package requires [dyrynda/laravel-efficient-uuid](https://github.com/michaeldyrynda/laravel-efficient-uuid), this package will override the default behaviour of Laravel so that a `uuid()` migration will not become a `VARCHAR(36)` but a `BINARY(16)` field.

### Trait

[](#trait)

Next up you should use the trait `Hpolthof\Laravel\EloquentUuid\Uuid` in your Eloquent model.

You'll have to add a method `uuidColumns()` to your model. This should return an array with the fields that are UUIDs.

```
protected function uuidColumns(): array
{
    return ['id'];
}
```

### Primary Key

[](#primary-key)

If you've added your primary key as a UUID column, the model will automatically set a new UUID on the creation of the model into the database.

Disclaimer
----------

[](#disclaimer)

This package is used for internal development, but published for public use. Obviously this software comes *as is*, and there are no warranties or whatsoever.

If you like the package it is always appreciated if you drop a message of gratitude! ;-)

The package was build by: Paul Olthof

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

2468d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de1aeabf860985f978f94da5a6fe0fee1df693abb2ab2453375bdfc013b3f8ac?d=identicon)[hpolthof](/maintainers/hpolthof)

### Embed Badge

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

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dyrynda/laravel-model-uuid

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

4802.8M8](/packages/dyrynda-laravel-model-uuid)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

9.4k2.8k](/packages/leantime-leantime)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[cuonggt/laravel-dibi

An elegant GUI database management tool for your Laravel applications.

5814.2k](/packages/cuonggt-laravel-dibi)

PHPackages © 2026

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