PHPackages                             mosamirzz/octane-grpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. mosamirzz/octane-grpc

ActiveLibrary[HTTP &amp; Networking](/categories/http)

mosamirzz/octane-grpc
=====================

Support gRPC server for laravel octane

0.4(1y ago)02.0k↑80%1MITPHPPHP ^8.1

Since Oct 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mohamed-samir907/octane-grpc)[ Packagist](https://packagist.org/packages/mosamirzz/octane-grpc)[ Docs](https://github.com/mosamirzz/octane-grpc)[ RSS](/packages/mosamirzz-octane-grpc/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Octane gRPC
===========

[](#octane-grpc)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3e4a51f88921ccc183c31e29b78d6bcc8c2bb105e480e6615dd305d5413ac80c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f73616d69727a7a2f6f6374616e652d677270632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mosamirzz/octane-grpc)[![Total Downloads](https://camo.githubusercontent.com/a7f52a7aeabcc8a48bbb5bf53dd387bfffd819a5ce3895914d09c4a2fdd243c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f73616d69727a7a2f6f6374616e652d677270632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mosamirzz/octane-grpc)

Add support for gRPC server in laravel octane.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mosamirzz/octane-grpc
```

Usage
-----

[](#usage)

1. add the following at the end of your octane.php config file.

```
return [
    // ...

    /*
    |--------------------------------------------------------------------------
    | gRPC Server
    |--------------------------------------------------------------------------
    |
    | The following setting used by the swoole gRPC server.
    |
    */

    'grpc' => [
        'host' => '0.0.0.0',
        'port' => 50051,
        'mode' => OpenSwoole\Http\Server::POOL_MODE,
        'services_path' => base_path('routes/grpc.php'),
    ],
];
```

2. create the routes file that will contains all the services that needs to be registered in the server.

```
touch routes/grpc.php
```

and the content of the file will be like:

```
