PHPackages                             brandoriented/uuid-doctrine - 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. brandoriented/uuid-doctrine

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

brandoriented/uuid-doctrine
===========================

Allow the use of ramsey/uuid as a Doctrine field type.

1.6.1(5y ago)0403MITPHPPHP ^7.4 | ^8

Since Sep 28Pushed 5y agoCompare

[ Source](https://github.com/BrandOriented/uuid-doctrine)[ Packagist](https://packagist.org/packages/brandoriented/uuid-doctrine)[ Docs](https://github.com/ramsey/uuid-doctrine)[ GitHub Sponsors](https://github.com/ramsey)[ RSS](/packages/brandoriented-uuid-doctrine/feed)WikiDiscussions master Synced 1mo ago

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

ramsey/uuid-doctrine
====================

[](#ramseyuuid-doctrine)

[![Source Code](https://camo.githubusercontent.com/e60f26025cc25ea13f69e748eb9aa57769393186c9c6a587817a3aec7f71b90b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d72616d7365792f757569642d2d646f637472696e652d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/ramsey/uuid-doctrine)[![Latest Version](https://camo.githubusercontent.com/6d32072358d17c15d2c7e870ef69448d0f4ec21e71c9132b34a9f35f4143363f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72616d7365792f757569642d646f637472696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ramsey/uuid-doctrine)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ramsey/uuid-doctrine/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/ad3362a4475196a5591861f8a6e144b9a9dac92b4ffba5d294ac43625789b8a5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72616d7365792f757569642d646f637472696e652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ramsey/uuid-doctrine)[![Coverage Status](https://camo.githubusercontent.com/b5aa687ad4ed9224c9bb6a05febdbbdab58f342f0bb43e873bcdb606dc0e431c/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f72616d7365792f757569642d646f637472696e652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/ramsey/uuid-doctrine?branch=master)[![Total Downloads](https://camo.githubusercontent.com/bb552fe6686b2576c3848c1016867fb0e71462d2949726c72727c9bcd671390b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72616d7365792f757569642d646f637472696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ramsey/uuid-doctrine)

The ramsey/uuid-doctrine package provides the ability to use [ramsey/uuid](https://github.com/ramsey/uuid) as a [Doctrine field type](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.10/reference/types.html).

This project adheres to a [Contributor Code of Conduct](https://github.com/ramsey/uuid-doctrine/blob/master/.github/CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code.

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

[](#installation)

The preferred method of installation is via [Packagist](https://packagist.org/packages/ramsey/uuid-doctrine) and [Composer](http://getcomposer.org/). Run the following command to install the package and add it as a requirement to your project's `composer.json`:

```
composer require ramsey/uuid-doctrine
```

Examples
--------

[](#examples)

### Configuration

[](#configuration)

To configure Doctrine to use ramsey/uuid as a field type, you'll need to set up the following in your bootstrap:

```
\Doctrine\DBAL\Types\Type::addType('uuid', 'Ramsey\Uuid\Doctrine\UuidType');
```

In Symfony:

```
# config/packages/doctrine.yaml
doctrine:
    dbal:
        types:
            uuid: Ramsey\Uuid\Doctrine\UuidType
```

In Zend Framework:

```
