php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -


i trying use grpc in laravel project.

this part of composer.json file:

"require": {     ...     "datto/protobuf-php": "dev-master",     "google/auth": "^0.7.0",     "grpc/grpc": "dev-release-0_13",     ... } 

i have generated php file proto file. placed in app/services/ , included in composer.json autoload.files section. have run composer install without issues.

i have created route testing. has following code:

$client = new vat_service\vatserviceclient('localhost:50051', [     'credentials' => grpc\channelcredentials::createinsecure() ]); 

but receive response class 'grpc\channelcredentials' not found. when visit route.

the laravel app running in homestead vagrant box.

i don't know how proceed. missing dependency? did miss install something?

i have solved problem, not sure of below steps solution.

things tried:

  • i installed grpc-beta in homestead box (sudo pecl install grpc-beta).
  • i updated "grpc/grpc": "dev-release-0_13" "grpc/grpc": "^0.15.0".
  • i added repository composer.json:

    "repositories": [     {         "type": "vcs",         "url": "https://github.com/stanley-cheung/protobuf-php"     } ], 
  • i restarted nginx inside homestead box
  • i updated composer composer self-update

i added answer. please advise if better suited edit opening question or comment.

also, interesting learn solution was.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -