PHPackages                             neon/model-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. neon/model-uuid

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

neon/model-uuid
===============

1.0.2(1y ago)06267MITPHPPHP &gt;=8.0

Since Feb 2Pushed 1y ago3 watchersCompare

[ Source](https://github.com/elementary-interactive/neon-model-uuid)[ Packagist](https://packagist.org/packages/neon/model-uuid)[ RSS](/packages/neon-model-uuid/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (7)

NEON — UUID
===========

[](#neon--uuid)

This Trait is one of the very basic parts of the NEON. It turns Laravel Eloquent Model to use UUID as primary key.

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

[](#installation)

You can install the package via composer:

```
composer require neon/model-uuid
```

This will install the Trait itself.

Usage
-----

[](#usage)

To use it on a Model, you have to make the migration ready to use string key isntead of incrementing integer:

```
  /** Create `awesome_uuids` table.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('awesome_uuids', function (Blueprint $table) {
      $table->uuid('id')
        ->primary();
    });
  }
```

You just should use the Trait on the Model.

```
