https://github.com/fendui/lar…

The installation

composer require fendui/laravel-hprose dev-master

configuration

Register the HProSeserviceProvider in config/app.php

'providers' => [
    .....
    \fendui\HproseServiceProvider::class
 ]

Create configuration and demo routing files

php artisan vendor:publish --provider="fendui\HproseServiceProvider"

Server-side method injection and class injection

\fendui\Facades\HproseRoute::add(function () {
    return 'service hello';
}, 'hello');

\fendui\Facades\HproseRoute::add(\fendui\demoService::class);

Start the RPC service

php artisan hprose:socket

Client invocation

$uris, = [' TCP: / / 127.0.0.1:1314]. $client = new \fendui\Clients\SocketClient($uris, false); $client - > hello () $client - > fendui_demoService - > kan () need to configure the configuration 'client' = > [' tcp_uris' = > [' TCP: / / 127.0.0.1:1314 ']. 'async' => false ], app('hprose.socket.client')->hello()

Demo looks at how to register

http://127.0.0.1:8000/rpc

You can see the invocation through the route

http://127.0.0.1:8000/rpc/kan
http://127.0.0.1:8000/rpc/demo/say
http://127.0.0.1:8000/rpc/demo/kan
http://127.0.0.1:8000/rpc/demo/can