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

ActiveLaravel-package[Database &amp; ORM](/categories/database)

fahriztx/model-uuid
===================

A Laravel Package to handle Primary Key using UUID

v1.0.1(1y ago)025MITPHP

Since Jul 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/FAHRIZTX/ModelUuid)[ Packagist](https://packagist.org/packages/fahriztx/model-uuid)[ RSS](/packages/fahriztx-model-uuid/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Model Uuid
==========

[](#model-uuid)

A Laravel Package to handle Primary Key using UUID

Requirements
------------

[](#requirements)

- Laravel 10.x

Easy Installation
-----------------

[](#easy-installation)

Run the following command in your Laravel project:

```
composer require fahriztx/model-uuid
```

Make sure your migration file has a column with the type of UUID (using `$table->uuid`) as primary key.

Example:

```
    public function up(): void
    {
        Schema::create('your_migration', function (Blueprint $table) {
            $table->uuid('id')->primary();  // Primary Key using $table->uuid('your_primary_column')->primary();
            ...
            $table->timestamps();
        });
    }
```

Usage
-----

[](#usage)

Add `use \Fahriztx\ModelUuid\Uuid;` to your model.

Example `Models/YourModel.php`:

```
