承接 juniorb2ss/eloquent-uuid 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

juniorb2ss/eloquent-uuid

Composer 安装命令:

composer require juniorb2ss/eloquent-uuid

包简介

Trait to implement UUID in Eloquent ORM

README 文档

README

Build Status Code Coverage Laravel Scrutinizer Code Quality StyleCI Code Climate

The juniorb2ss/eloquent-uuid provider a simple trait to implement UUID to ORM.

Install

You can install this package via composer:

$ composer require juniorb2ss/eloquent-uuid~1.*

Eloquent Trait

use juniorb2ss\EloquentUuid\EloquentUuidTrait;

class User extends Authenticatable
{
    use Notifiable, EloquentUuidTrait;
    
    /**
    * UUID Column name used
    * 
    * @var string
    * @optional 
    */
    protected $uuidKey = 'uuid';
}

UUID Column

You need create new column in table model like uuid or custom name you can define in uuidKey model property

Example

$fields = $request->only(['email', 'name', 'password']);
$user = User::create($fields); // Creating user with auto-inject uuid field

dump($user->toArray());

/*[
    "id" => "1"
    "uuid" => "723e4628-7c35-11e7-89b1-0242bfc0df57",
    "name" => "Magdalena Zboncak"
    "email" => "nitzsche.katherine@gulgowski.com"  
  ]*/

Scope On UUID

use App\User;

$user = (new User)->onUuid('aae5f3f1-0f22-4a8b-9291-d2a9649d1490')
                  ->firstOrFail();

Tests

composer run test

Change log

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固