friendsofhyperf/grpc-validation

The GRPC validation component for Hyperf.


README

Latest Stable Version Total Downloads GitHub license

The GRPC validation component for Hyperf.

Installation

composer require friendsofhyperf/grpc-validation

Usage

<?php

use FriendsOfHyperf\GrpcValidation\Annotation;

#[Validation(rules: [
    'name' => 'required|string|max:10',
    'message' => 'required|string|max:500',
])]
public function sayHello(HiUser $user) 
{
    $message = new HiReply();
    $message->setMessage("Hello World");
    $message->setUser($user);
    return $message;
}

Contact

License

MIT