PHPackages                             glorand/laravel-eloquent-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. glorand/laravel-eloquent-model-uuid

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

glorand/laravel-eloquent-model-uuid
===================================

A simple solution for providing UUID support for the IDs of your Eloquent models.

4.0.0(4y ago)31.0k[5 PRs](https://github.com/glorand/laravel-eloquent-model-uuid/pulls)MITPHPPHP &gt;=7.1.3CI failing

Since Jul 8Pushed 7mo ago1 watchersCompare

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

READMEChangelog (6)Dependencies (5)Versions (14)Used By (0)

Laravel eloquent model uuid
===========================

[](#laravel-eloquent-model-uuid)

[![Latest Stable Version](https://camo.githubusercontent.com/825df4ccf068769a4b2e71fffa49598e0b9b832d26dc757f3f354d8f811eb91c/68747470733a2f2f706f7365722e707567782e6f72672f676c6f72616e642f6c61726176656c2d656c6f7175656e742d6d6f64656c2d757569642f762f737461626c65)](https://packagist.org/packages/glorand/laravel-model-settings)[![Build Status](https://camo.githubusercontent.com/584d01e00332acb92471557c31133cd43e29924f4b9cd9a58bd8297e173b431e/68747470733a2f2f7472617669732d63692e636f6d2f676c6f72616e642f6c61726176656c2d656c6f7175656e742d6d6f64656c2d757569642e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/glorand/laravel-eloquent-model-uuid)[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)[![StyleCI](https://camo.githubusercontent.com/1ce05fbe03edf0a0e724052c6f6cceb8a5763fbaf0f3785d6d4f5b54e6e5cfa1/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3139343733313038362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/194731086)[![Code Intelligence Status](https://camo.githubusercontent.com/58b5d9a7edc18a00e38a1ee9091e34fb156e2a4da397ef59e1877236694c1f68/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676c6f72616e642f6c61726176656c2d656c6f7175656e742d6d6f64656c2d757569642f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/07f9539a9aa038e82b1ed2f97b1d79d9635e06e0127d20e54886f89a39dfabfc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676c6f72616e642f6c61726176656c2d656c6f7175656e742d6d6f64656c2d757569642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/glorand/laravel-eloquent-model-uuid/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/190a59efa2bea8bb493d9dea67763695ad811cfc2fd0042ca648795207dd4a5f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676c6f72616e642f6c61726176656c2d656c6f7175656e742d6d6f64656c2d757569642f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/glorand/laravel-eloquent-model-uuid/?branch=master)

A simple solution for providing UUID support for the IDs of your Eloquent models.

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

[](#installation)

You can install the package via composer:

```
composer require glorand/laravel-eloquent-model-uuid
```

Usage
-----

[](#usage)

Let us start on the database side of things.

```
$table->uuid('id');
$table->primary('id');
//OR
$table->uuid('id')->primary();
```

### Use model class provided by this package

[](#use-model-class-provided-by-this-package)

Instead of extending the standard Laravel model class, extend from the model class provided by this package:

```
