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

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

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

eig/eloquent-uuid

最新稳定版本:3.0.0

Composer 安装命令:

composer require eig/eloquent-uuid

包简介

Easy UUID for Eloquent Models

README 文档

README

Build Status Latest Stable Version Coverage Status License StyleCI Total Downloads Latest Unstable Version

A Package for easily adding UUID's to Eloquent Models supporting Laravel 5.5+

Usage

To use UUID in an Eloquent Model install the package with:

composer require eig/eloquent-uuid

Then in your Model instead of extending Model extend EloquentUUID like so:

<?php

namespace App;

use eig\EloquentUUID\EloquentUUID;

class UUIDModel extends EloquentUUID
{

}

Then in your migrations make sure you set id to string or uuid like this:

public function up()
    {
        Schema::create('client_models', function (Blueprint $table) {
            $table->uuid('id');
            $table->softDeletes();
            $table->timestamps();
        });
    }

User UUID Model

For Laravel 5.3+, the standard user model that comes with the framework extends Authenticatble for the new multi-auth system. To add in UUID's to the user model extend eig\EloquentUUID\UUIDUser which will add in the UUID to the user while still extending Laravel's Authenticatable class. The migration schema changes for extending EloquentUUID are the same for extending from UUIDUser.

UUID Trait

As of version 1.1.0, EloquentUUID now has a trait named UUID in the namespace eig\EloquentUUID\Traits\UUID, that you can use to compose a UUID class. The trait implements a UUID assignment in a __constructor() method. The migration schema changes for extending EloquentUUID are the same for using the UUID trait.

Supported PHP Versions

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固