0
7
Login
Code
Issues
Pull requests
Events
Packages
56bfceba865f171023c7e665b881126fa909e4a3
56bfceba865f171023c7e665b881126fa909e4a3

Hyperf grpc-validation

Latest Stable Version Total Downloads GitHub license

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;
}