PHPackages                             friendsofhyperf/command-validation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. friendsofhyperf/command-validation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

friendsofhyperf/command-validation
==================================

The command validation component for Hyperf.

v3.2.1(3w ago)010MITPHP

Since Feb 10Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/friendsofhyperf/command-validation)[ Packagist](https://packagist.org/packages/friendsofhyperf/command-validation)[ Fund](https://hdj.me/sponsors/)[ GitHub Sponsors](https://github.com/huangdijia)[ RSS](/packages/friendsofhyperf-command-validation/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (12)Versions (38)Used By (0)

Command Validation
==================

[](#command-validation)

[中文说明](README_CN.md)

Validate a Hyperf command's arguments and options before the command runs.

Installation
------------

[](#installation)

```
composer require friendsofhyperf/command-validation
```

The package requires Hyperf `~3.2.0`, including `hyperf/validation`, and declares no optional dependencies. Hyperf discovers the component's empty `ConfigProvider` automatically, so the component has no configuration to publish.

Usage
-----

[](#usage)

Add the `ValidatesInput` trait to a command and override `rules()`. You may also override `messages()` and `attributes()` to customize validation errors.

```
