fyggi/laravel-simple-uuid

This package adds a simple trait to add UUID to your models.

v1.0 2020-04-05 18:48 UTC

This package is auto-updated.

Last update: 2024-04-06 04:57:42 UTC


README

Latest Version on Packagist Total Downloads Quality Score StyleCI Treeware

This package adds a simple trait to add UUID to your Laravel models. When using the trait, it automatically sets the route key and route key name to the UUID.

The trait also includes a scope, whereUuid($uuid).

NOTE: The package assumes you have a field in your database called uuid.

Installation

You can install the package via composer:

composer require fyggi/laravel-simple-uuid

Example

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Fyggi\SimpleUuid\HasUuid;

class Post extends Model
{
    use HasUuid;
}

Security

If you discover any security related issues, please email peter@fyggi.dk instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Treeware

You're free to use this package, but if it makes it to your production environment you are required to buy the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you support this package and contribute to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees here offset.earth/treeware

Read more about Treeware at treeware.earth

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.