承接 ewereka/laravel-extra-validation 相关项目开发

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

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

ewereka/laravel-extra-validation

Composer 安装命令:

composer require ewereka/laravel-extra-validation

包简介

A set of extended validation rules for use with Laravel.

README 文档

README

This package provides a set of reusable validation rules for your Laravel projects. Use them to augment the existing set provided by Laravel itself.

Installation

Pull in the package using composer

composer require ewereka/laravel-extra-validation

Usage

As per the Laravel documentation, simply import the relevant validation class wherever you require it, and then include it within the rules for a particular field:

use Ewereka\Validation\Rules\StrongPassword;

// ...

$request->validate([
    'password' => ['bail', 'required', new StrongPassword],
]);

If the validation fails, the package will attempt to respond with a localized error message (see message keys below). If the key does not exist, it will fall back to a hard-coded English language version.

Available rules

The following validation rules are currently available:

Rule Message Key Description
StrongPassword validation.strong_password Requires the presence of a "strong" password - see class for details
USPhoneNumber validation.us_phone_number Requires the presence of a valid US telephone number - see class for details
RecordOwner validation.record_owner Requires the authenticated user's id to match the user_id column on a given database record e.g. owner:posts,id
MonetaryFigure validation.monetary_figure Requires the presence of a monetary figure e.g $72.33 - see class for details
DisposableEmail validation.disposable_email Requires the presence of an email address which is not disposable
DoesNotExist validation.does_not_exist Requires that the given value is not present in a given database table / column - see class for details
Decimal validation.decimal Requires that the given value is a decimal with an appropriate format - see class for details
EncodedImage validation.encoded_image Requires that the given value is a base64-encoded image of a given mime type - see class for details
LocationCoordinates validation.location_coordinates Requires that the given value is a comma-separated set of latitude and longitude coordinates
FileExists validation.file_exists Requires that the given value is a path to an existing file - see class for details
Equals validation.equals Requires that the given value is equal to another given value
MacAddress validation.mac_address Requires that the given value is a valid MAC address
ISBN validation.isbn Requires that the given value is a valid ISBN-10 or ISBN-13 number
EndsWith validation.ends_with Requires that the given value ends with a given string - see class for details
EvenNumber validation.even_number Requires that the given value is an even number (decimals are first converted using intval)
OddNumber validation.odd_number Requires that the given value is an odd number (decimals are first converted using intval)
Lowercase validation.lowercase Requires that the given value is a lowercase string
Uppercase validation.uppercase Requires that the given value is a uppercase string
Titlecase validation.titlecase Requires that the given value is a titlecase string
Domain validation.domain Requires that the given value be a domain e.g. google.com, www.google.com
CitizenIdentification validation.citizen_identification Requires that the given value be a citizen identification number of usa, uk or france (see class for details)
WithoutWhitespace validation.without_whitespace Requires that the given value not include any whitespace characters

The package will receive new rules over time, however since these updates will not be breaking changes, they will not receive major version numbers unless Laravel changes in such a way that the package requires a re-write.

Contributions

You are welcome to submit pull requests containing your own validation rules, however to be accepted, they must explain what they do, be useful to others, and include a suitable test to confirm they work correctly.

License

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

ewereka/laravel-extra-validation 适用场景与选型建议

ewereka/laravel-extra-validation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 09 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「validation」 「rules」 「laravel」 「ewereka」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ewereka/laravel-extra-validation 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ewereka/laravel-extra-validation 我们能提供哪些服务?
定制开发 / 二次开发

基于 ewereka/laravel-extra-validation 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-05