saade-package/generate-unique-id
最新稳定版本:v1.0.0
Composer 安装命令:
composer require saade-package/generate-unique-id
包简介
A package to generate unique ID
README 文档
README
it generates an private id for database
This code is using in laravel application to generate an unique id and also it will check if the generated id
is the same in database it will generate a new . 😉
Installing :
composer require saade-package/generate-unique-id
Now how to use it ?
For example if you created an id-generator column in post table, you can make an private id to the post like this :
public function store(Request $request){ DB::table('generated_id')->insert([ 'generatedID'=>generateUniqueId('generatedIdTable','generatedIdColumn') ]); }
| Option | Description |
|---|---|
| table name | (string & require) it is the table name where You want to insert the data in it. |
| column name | (string & require) it is the table column where You want to insert the data in it. |
The generate function generateUniqueId function takes 2 arguments , the first argument is the Table name and
the second argument is the column name where you want to insert the uniqueId .
Here this code will generate an id from 25 characters and inserts it in database .
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-26