PHPackages                             friendsofhyperf/grpc-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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. friendsofhyperf/grpc-validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

friendsofhyperf/grpc-validation
===============================

The GRPC validation component for Hyperf.

v3.2.1(3w ago)51.6k1MITPHP

Since Jun 10Pushed 2w ago2 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (76)Used By (0)

gRPC Validation
===============

[](#grpc-validation)

[中文说明](README_CN.md)

Validate a protobuf request before a Hyperf gRPC service method runs.

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

[](#installation)

```
composer require friendsofhyperf/grpc-validation
```

The component targets Hyperf 3.2 and requires `hyperf/context`, `hyperf/di`, `hyperf/grpc-server`, and `hyperf/validation`. Composer installs these dependencies, and the package's `ConfigProvider` automatically registers the validation aspect. There is no component configuration file to publish.

Basic Usage
-----------

[](#basic-usage)

Add `Validation` to a gRPC service method and define Hyperf validation rules for the protobuf message fields:

```
