PHPackages                             salmanzafar/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. salmanzafar/laravel-model-uuid

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

salmanzafar/laravel-model-uuid
==============================

A Laravel UUID Package

v1.0.1(5y ago)11127[1 issues](https://github.com/salmanzafar949/laravel-model-uuid/issues)MITPHPPHP ^7.0 || ^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0

Since Apr 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/salmanzafar949/laravel-model-uuid)[ Packagist](https://packagist.org/packages/salmanzafar/laravel-model-uuid)[ Fund](https://www.buymeacoffee.com/salmanzafar949)[ Patreon](https://www.patreon.com/salmanzafar949)[ RSS](/packages/salmanzafar-laravel-model-uuid/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (1)Versions (3)Used By (0)

laravel-model-uuid
==================

[](#laravel-model-uuid)

A Laravel package to add uuid to models

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration-optional)
- [Model Uuid](#model-uuid)
- [Publishing files / configurations](#publishing-files)

Installation
============

[](#installation)

```
composer require salmanzafar/laravel-model-uuid
```

Configuration (optional)
------------------------

[](#configuration-optional)

Publishing service provider

```
php artisan vendor:publish --provider="Salman\LaravelModelUUID\LaravelModelUUISServiceProvider::class"
```

Enable the package (Optional)
-----------------------------

[](#enable-the-package-optional)

This package implements Laravel auto-discovery feature. After you install it the package provider and facade are added automatically for laravel &gt;= 5.5.

### Model Uuid

[](#model-uuid)

There are many cases where we want to use `uuid` as `primray key` in our model now that is also easier you can use `uuid` as `pk` in a jiffy

```
namespace App;

use \Vault\LaravelVaultUUID\Concerns\UsesUuid;
use Illuminate\Database\Eloquent\Model;

class Car extends Model
{
   use UsesUuid;
}
```

By just using `UsesUuid` in your model now you have `uuid` as `pk` in your model. don't forget to make changes in migration

```
