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

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

recycledbeans/eloquent-uuid
===========================

A quick and easy way to use UUID primary keys in Laravel Eloquent models.

v1.0.0(5y ago)0622MITPHP

Since Aug 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/recycledbeans/eloquent-uuid)[ Packagist](https://packagist.org/packages/recycledbeans/eloquent-uuid)[ RSS](/packages/recycledbeans-eloquent-uuid/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Eloquent UUID
=============

[](#eloquent-uuid)

A quick and easy way to use UUID primary keys in Laravel Eloquent models.

### Installation

[](#installation)

Simply require the package with composer to add it to your Laravel application.

```
composer require recycledbeans/eloquent-uuid
```

### Usage

[](#usage)

Make sure your migrations use the `uuid()` field type and that the field is set as the primary key.

```
Schema::create('documents', function (Blueprint $table) {
    $table->uuid('id')->primary();
    $table->timestamps();
});
```

Then use the `UUID` trait in your Eloquent models to ensure your models automatically function with UUID primary keys.

```
