jberall / yii2-uuidbehavior
Attaches a Ramsey V4::UUID
Package info
github.com/jberall/yii2-uuidbehavior
Type:yii2-extension
pkg:composer/jberall/yii2-uuidbehavior
Requires
- ramsey/uuid: ^3.5
- yiisoft/yii2: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-05 09:09:07 UTC
README
Attaches a Ramsey V4::UUID
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist jberall/yii2-uuidbehavior "*"
or add
"jberall/yii2-uuidbehavior": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by : Where _id is the column in the database representing a UUID. public function behaviors() { return [ 'uuidBehavior' => [ 'class' => \jberall\uuidbehavior\UuidBehavior::className(), 'uuid_column' => '_id', ], ]; }