---
title: "lint/laravel/prefer-array-validation-rules"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="lint/laravel/prefer-array-validation-rules" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Safe fix. Runs when laravel is installed.

## What it does

Use array syntax for validation rules instead of 'a&#124;b' strings.

## Configuration

```toml title="pun.toml"
[lint.rules]
"laravel/prefer-array-validation-rules" = "error"
```

To skip it in some files or lines, add an [override](/docs/configuration/pun-toml#lint) or an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`Pun/prefer_array_validation_rules`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/) (pun)
- [`ValidationRuleArrayStringValueToArray`](https://getrector.com/rule-detail/validation-rule-array-string-value-to-array-rector) (rector-laravel)
- [`prefer-array-validation-rules`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#prefer-array-validation-rules) (mago-linter)

## Merged rules

These old IDs are now this rule. A config that still names one stops with an error. See [merged rules](/docs/migrate/merged-rules).

- `lint/laravel/prefer-validation-rule-array`

[More lint/laravel rules](/docs/rules/lint/laravel) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
