Skip to content

friendsofhyperf/grpc-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperf grpc-validation

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