承接 adamlien/pkuuids 相关项目开发

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

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

adamlien/pkuuids

最新稳定版本:v1.6

Composer 安装命令:

composer require adamlien/pkuuids

包简介

Using a UUID as PrimaryKey for laravel 5.3+

README 文档

README

PkUuids package use ramsey/uuid[https://github.com/ramsey/uuid] (official installed on 5.3+) to generate a UUID_v4(random) as primary key for Eloquent Model.

inspired by http://stackoverflow.com/questions/31817067/laravel-5-using-a-uuid-as-primary-key

Install

  1. Use composer to add the package into your project using composer require racklin/pkuuids:dev-master

Migrations

Use a UUID as primary key, we need to change $table->increments('id'); to $table->uuid('id')->primary();

Models

Disable auto-increment primary key

Add $incrementing = false; to your Models.

Use Traits

Add use PkUuuids; to your Models.

Example:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Racklin\PkUuids\PkUuids;

class User extends Model
{
    use PkUuids;

    public $incrementing = false;
}

Laravel version

Current package version works for Laravel 5.3+ 6.x 7.x 8.x 9.x 10.x

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固