hnhdigital-os / laravel-model-uuid
为 Eloquent ORM 提供 UUID 数据类型支持
1.0.9
2018-05-30 04:48 UTC
Requires
- php: >=7.0
- webpatser/laravel-uuid: 3.*
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- illuminate/database: 4.*|5.*
- phpunit/phpunit: 4.*
- symfony/process: ~2.3
README
__ ____ ____ __________
/ / ____ __________ __ _____ / / / / / / / / _/ __ \
/ / / __ `/ ___/ __ `/ | / / _ \/ / / / / / / // // / / /
/ /___/ /_/ / / / /_/ /| |/ / __/ / /_/ / /_/ // // /_/ /
/_____/\__,_/_/ \__,_/ |___/\___/_/\____/\____/___/_____/
为模型添加 UUID 数据类型列的支持。
本包由澳大利亚精品开发公司 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)。有关更多信息,请参阅 许可证文件。