dij-digital/deconstructed-validation-messages 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dij-digital/deconstructed-validation-messages

最新稳定版本:1.1

Composer 安装命令:

composer require dij-digital/deconstructed-validation-messages

包简介

README 文档

README

Is your application headless or an API? Do you want all your translations to be done in the frontend? Then this is the package for you. Instead of returning the translated error strings from the Laravel translation files, this package returns the original translation keys, the parameters and their values.

Installation

You can install the package via composer:

composer require dij-digital/deconstructed-validation-messages

Optionally you can publish the config file with:

php artisan vendor:publish --tag="deconstructed-validation-messages-config"

This is the contents of the published config file:

return [
];

Usage

Simply install the package and make sure the provider is registered. The package will automatically take care of the rest.

Your response will look like this:

{
  "field": {
    "rule": {
      "key": "rule.language_key",
      "message": "Traditional error message",
      "parameters": {
        "x": 1,
        "y": 2
      }
    }
  }
}

Testing

composer test

Changelog

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

Credits

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-31