定制 calatoiu/cnpcui-rule 二次开发

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

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

calatoiu/cnpcui-rule

最新稳定版本:1.0.1

Composer 安装命令:

composer require calatoiu/cnpcui-rule

包简介

A Laravel validation rule to validate CNPCUI numbers

README 文档

README

GitHub GitHub issues Packagist Downloads GitHub Release

This package provides a custom validation rule for Laravel to validate (CNPCUIs).

🧰 Requirements

  • PHP >= 8.1
  • Laravel >= 10

⚙️ Installation

You can install this package using Composer:

composer require calatoiu/cnpcui-rule

👾 Usage

To use the CNPCUI validation rule, simply add it to your Laravel validation rules. Here's an example:

use Illuminate\Http\Request;
use calatoiu\CnpcuiRule\ValidCnpcui;


public function store(Request $request)
{
    $request->validate([
        'cnpcui' => ['required', new ValidCnpcui()],
    ]);

    // The rest of your code
}

👽 Customize error message

You can use your own validation message (by default will be The :attribute is not a valid CNPCUI.).

⚠️ If you don't have these folders use php artisan lang:publish

Simply:

# Path
\main_folder_project
    \lang
        \app_language(ex.'en')
            validation.php

# Add 'cnpcui' key
<?php
    // validation.php inside 'it' folder

    'cnpcui' => 'CNPCUI non valido.'


# Now you're validation message will be translated!

🤝 Contribution

If you find any issues or have suggestions for improvements, feel free to open a pull request or issue. Your contribution is highly appreciated.

🔨 Test

composer test

📝 License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固