定制 macsidigital/laravel-uuid 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

macsidigital/laravel-uuid

最新稳定版本:5.0.1

Composer 安装命令:

composer require macsidigital/laravel-uuid

包简介

Laravel UUID package

README 文档

README

UUID's on Laravel models

Header Image

tests badge version badge downloads badge

Laravel UUID, a UUID helper Library

Support us

We invest a lot in creating open source packages, and would be grateful for a sponsor if you make money from your product that uses them.

Installation

This package can be used in Laravel 10.0 or higher with PHP 8.0 and higher. There are older versions which go back to PHP7.4 and Laravel 6.

You can install the package via composer:

composer require macsidigital/laravel-uuid

Usage

This is quite a simple package, which can be used to override the primary key to uuid, or to add an additional uuid field, our preferred option to keep an incrementing index.

Add a uuid field

	// primary key implementation
    $table->uuid('id')->primary();
    
    // or implementation for additional field

    $table->uuid('uuid');  

});

Add the trait to get automatic UUID generation

namespace App\Models;
use Uuid\Traits\GeneratesUuid;

class FakeModel extends Model
{

use GeneratesUuid;

}

That's it! unless we use a different column name for the uuid field, then we add the following method.

	 public function uuidColumn(): string
    {
        return 'id';
    }
});

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email info@macsi.co.uk instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-04