PHPackages                             jasonmccallister/laravel-uuid-as-id - 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. jasonmccallister/laravel-uuid-as-id

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

jasonmccallister/laravel-uuid-as-id
===================================

Simple Laravel package that includes a trait for using UUIDs and IDs on Eloquent models

v0.1.0(7y ago)024MITPHPPHP ^7.1

Since May 14Pushed 7y agoCompare

[ Source](https://github.com/jasonmccallister/laravel-uuid-as-id)[ Packagist](https://packagist.org/packages/jasonmccallister/laravel-uuid-as-id)[ Docs](https://github.com/jasonmccallister/laravel-uuid-as-id)[ RSS](/packages/jasonmccallister-laravel-uuid-as-id/feed)WikiDiscussions master Synced yesterday

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

Use UUID as ID in Laravel
=========================

[](#use-uuid-as-id-in-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5bef724a64ba3710ba8dc5de07a0cd0feb24615330bc574e81ac170f54768368/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a61736f6e6d6363616c6c69737465722f6c61726176656c2d757569642d61732d69642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jasonmccallister/laravel-uuid-as-id)[![Total Downloads](https://camo.githubusercontent.com/a84f959a25b7858f3cb9181be86c01ab5745fdb07b5e80f5fb61bbffe7292c6c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a61736f6e6d6363616c6c69737465722f6c61726176656c2d757569642d61732d69642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jasonmccallister/laravel-uuid-as-id)

This is a simple trait that will override the key on an eloquent model to create a UUID instead of an integer.

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

[](#installation)

You can install the package via composer:

```
composer require jasonmccallister/laravel-uuid-as-id
```

Usage
-----

[](#usage)

Update your models to use the trait, and you are done!

```
