I am trying to use grpc in a Laravel project.
This is a part of my composer.json file:
"require": {
...
"datto/protobuf-php": "dev-master",
"google/auth": "^0.7.0",
"grpc/grpc": "dev-release-0_13",
...
}
I have generated a php file from my proto file. It is placed in app/services/ and included in the composer.json autoload.files
section. I have run composer install
without issues.
I have created a route for testing. It has the following code:
$client = new vat_service\VatServiceClient('localhost:50051', [
'credentials' => Grpc\ChannelCredentials::createInsecure()
]);
But I receive the response Class 'Grpc\ChannelCredentials' not found.
when I visit the route.
The Laravel app is running in a Homestead vagrant box.
I don't know how to proceed. Am I missing a dependency? Did I miss to install something?