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

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

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

kduma/eloquent-guidable

最新稳定版本:2.01

Composer 安装命令:

composer require kduma/eloquent-guidable

包简介

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

README 文档

README

For new apps, please use the newer version available here: kduma/eloquent-uuidable

L5-eloquent-guidable

Latest Stable Version Total Downloads Latest Unstable Version License SensioLabsInsight StyleCI

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

Setup

Add the package to the require section of your composer.json and run composer update

"kduma/eloquent-guidable": "^1.1"

Prepare models

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

use \KDuma\Eloquent\Guidable;

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

$table->string('guid')->unique();

Usage

By default it generates slug on first save.

  • $model->newGuid() - Generate new guid. (Remember to save it by yourself)
  • Model::whereGuid($slug)->first() - Find by guid. (whereGuid is query scope)

Packagist

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-05