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

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

stayallive/laravel-eloquent-uuid
================================

Generate UUID for a Laravel Eloquent model attribute.

v1.0.5(2mo ago)423.9k↓37.8%4MITPHPPHP ^8.0.2CI passing

Since Feb 28Pushed 2mo ago1 watchersCompare

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

READMEChangelog (6)Dependencies (10)Versions (7)Used By (4)

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

[](#laravel-eloquent-uuid)

[![Latest Version](https://camo.githubusercontent.com/b2ce4bc70e805b1298b1ae32db4dad75739a2132246157fc19a4cabdf7510a9c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73746179616c6c6976652f6c61726176656c2d656c6f7175656e742d757569642e7376673f7374796c653d666c61742d737175617265)](https://github.com/stayallive/laravel-eloquent-uuid/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/64853f0baf12800a2bae14d6d4523dc77683db96b77a70707cea5a388c421bdf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73746179616c6c6976652f6c61726176656c2d656c6f7175656e742d757569642f63692e79616d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/stayallive/laravel-inverse-relations/actions/workflows/ci.yaml)[![Total Downloads](https://camo.githubusercontent.com/8a663e995a049e606a59c267243f079e292a11c964cefcde3afb436403203d1f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746179616c6c6976652f6c61726176656c2d656c6f7175656e742d757569642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stayallive/laravel-eloquent-uuid)

Generate UUID for a Laravel Eloquent model attribute.

> **Note**This package still works great, however since Laravel 10 this package is no longer needed as Laravel now has a built-in UUID/ULID traits that work much the same as this package. Read more about UUID/ULID in the [Laravel documentation](https://laravel.com/docs/10.x/eloquent#uuid-and-ulid-keys).

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

[](#installation)

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

Usage
-----

[](#usage)

Adding the `UsesUUID` trait will ensure that the key attribute will be filled with a UUID.

```
