Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stayallive/laravel-eloquent-uuid

Generate a UUIDv4 for the primary key or any other attribute on an Eloquent model.
https://github.com/stayallive/laravel-eloquent-uuid

eloquent laravel-package

Last synced: 7 days ago
JSON representation

Generate a UUIDv4 for the primary key or any other attribute on an Eloquent model.

Awesome Lists containing this project

README

        

# Laravel Eloquent UUID

[![Latest Version](https://img.shields.io/github/release/stayallive/laravel-eloquent-uuid.svg?style=flat-square)](https://github.com/stayallive/laravel-eloquent-uuid/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/github/actions/workflow/status/stayallive/laravel-eloquent-uuid/ci.yaml?branch=master&style=flat-square)](https://github.com/stayallive/laravel-inverse-relations/actions/workflows/ci.yaml)
[![Total Downloads](https://img.shields.io/packagist/dt/stayallive/laravel-eloquent-uuid.svg?style=flat-square)](https://packagist.org/packages/stayallive/laravel-eloquent-uuid)

Generate UUID for a Laravel Eloquent model attribute.

> **Note**
> This package still works great, however since Laravel 10 this package is no longer needed as Laravel now has a built-in UUID/ULID traits that work much the same as this package. Read more about UUID/ULID in the [Laravel documentation](https://laravel.com/docs/10.x/eloquent#uuid-and-ulid-keys).

## Installation

```bash
composer require stayallive/laravel-eloquent-uuid
```

## Usage

Adding the `UsesUUID` trait will ensure that the key attribute will be filled with a UUID.

```php
getKeyName();
}
}
```

## Security Vulnerabilities

If you discover a security vulnerability within this package, please send an e-mail to Alex Bouma at `[email protected]`. All security vulnerabilities will be swiftly addressed.

## License

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).