kduma/eloquent-ulidable 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kduma/eloquent-ulidable

最新稳定版本:v1.0.0

Composer 安装命令:

composer require kduma/eloquent-ulidable

包简介

Eases using and generating ulid's in Laravel Eloquent models.

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Eases using and generating ulid's in Laravel Eloquent models.

Check full documentation here: opensource.duma.sh/libraries/php/eloquent-ulidable

Setup

Install it using composer

composer require kduma/eloquent-ulidable

Prepare models

Inside your model (not on top of file) add following lines:

use \KDuma\Eloquent\Ulidable;

In database create ulid string field. If you use migrations, you can use following snippet:

$table->ulid()->unique();

Usage

By default, it generates slug on first save.

  • $model->regenerateUlid() - Generate new ulid. (Remember to save it by yourself)
  • Model::whereUlid($ulid)->first() - Find by ulid. (whereUlid is query scope)

Packagist

View this package on Packagist.org: kduma/eloquent-ulidable

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-26