# adonis-custom-validation-messages

> - If you used `adonis make:validator` command:

Latest version **1.0.2** (published 2019-08-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install adonis-custom-validation-messages
pnpm add adonis-custom-validation-messages
yarn add adonis-custom-validation-messages
bun add adonis-custom-validation-messages
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-08-02 |
| First published | 2019-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | clexapp |

## Links

- npm: https://www.npmjs.com/package/adonis-custom-validation-messages
- Repository: https://github.com/SanjayBanjade/adonis-custom-validation-messages
- Homepage: https://github.com/SanjayBanjade/adonis-custom-validation-messages#readme
- Issues: https://github.com/SanjayBanjade/adonis-custom-validation-messages/issues
- npm.io page: https://npm.io/package/adonis-custom-validation-messages

## Recent versions

- 1.0.2 (latest) — 2019-08-02
- 1.0.1 — 2019-08-02
- 1.0.0 — 2019-07-31

## README

## Usage

-   If you used `adonis make:validator` command:

```
"use strict"

const validationMessages = require("adonis-custom-validation-messages")

class ProductCreate {
    get rules() {
        return {
            // your rules
        }
    }

    get messages() {
        return validationMessages
    }

    async fails(errorMessages) {
        return this.ctx.response.unprocessableEntity(errorMessages)
    }
}
```

-   If you validate directly from your controller:

```
const validationMessages = require("adonis-custom-validation-messages")
validate(data, rules, validationMessages)
```

---
_Source: https://npm.io/package/adonis-custom-validation-messages · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
