bluora/laravel-model-uuid

该包已被放弃,不再维护。作者建议使用 hnhdigital-os/laravel-model-uuid 包。

为 Eloquent ORM 提供 UUID 数据类型支持

1.0.9 2018-05-30 04:48 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:03:46 UTC


README

    __                                ____  ____  __________ 
   / /   ____ __________ __   _____  / / / / / / / /  _/ __ \
  / /   / __ `/ ___/ __ `/ | / / _ \/ / / / / / / // // / / /
 / /___/ /_/ / /  / /_/ /| |/ /  __/ / /_/ / /_/ // // /_/ / 
/_____/\__,_/_/   \__,_/ |___/\___/_/\____/\____/___/_____/  
                                                             

为模型添加 UUID 数据类型列的支持。

Latest Stable Version Total Downloads Latest Unstable Version Built for Laravel License

Build Status StyleCI Test Coverage Issue Count Code Climate

此包由澳大利亚精品开发商 H&H|Digital 开发。欢迎访问我们的网站 hnh.digital

安装

通过 composer

$ composer require hnhdigital-os/laravel-model-uuid ~1.0

使用方法

基本使用

该功能通过将 UUID 列转换为 uuid 来通过 trait 暴露。

use Bluora\ModelUuidColumn\UuidTrait;

class User extends Model
{
    use UuidTrait;

    protected $casts = [
        'id' => 'integer',
        'uuid' => 'uuid'
    ];
}

查询 UUID 列

然后,您可以通过 whereUuid(单个 uuid)和 whereUuidIn(多个 uuid)方法查询 UUID 列。

贡献

有关详细信息,请参阅 CONTRIBUTING

致谢

许可

MIT 许可证 (MIT)。请参阅 许可文件 获取更多信息。