定制 discover/uniquecombination-validation 二次开发

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

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

discover/uniquecombination-validation

Composer 安装命令:

composer require discover/uniquecombination-validation

包简介

unique check validation by any combination value like comma separated value duplicate entry check

README 文档

README

This package is for unique validation with comma separated value('1,2,4') or other separated value('a-k-i') of sigle-column duplicate entry check.

Installation

Install the package through Composer. On the command line:

composer require discover/uniquecombination-validation

Configuration

Add the following to your providers array in config/app.php:

'providers' => [
    // ...

    Discover\UniqueCombination\UniqueCombinationServiceProvider::class,
],

Usage

Use it like any Validator :

$validator = Validator::make($request->all(), [
    'title' => 'required|unique_combination:table_name,column_name,separator',
]);

See the Validation documentation of Laravel.

Example

If you have a database table my_table and column which name is column_1 and the value is (25,36,21) already exists.

Your input field name is name_1 and value is (36,21,25). You want to check unique validation with your database column so that duplicate entry prevent with this comma separated combination:

$validator = Validator::make($request->all(), [
    'name_1' => 'required|unique_combination:my_table,column_1,","',
]);

Example-1

If you have a database table my_table and column which name is name_string and the value is (akash-jhon-jannat) already exists.

Your input field name is name and value is (Jannat-Jhon-akash). You want to check unique validation with your database column so that duplicate entry prevent with this comma separated combination:

$validator = Validator::make($request->all(), [
    'name' => 'required|unique_combination:my_table,name_string,"-"',
]);

You can also use any separator like('-','+') as your need. You can use and sort of combination this. This package is case-sensitive

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固