katsana/minions

JSON-RPC Communication for Laravel

v0.4.6 2019-07-31 14:45 UTC

README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Coverage Status

Installation

Minions can be installed via composer:

composer require "katsana/minions"

Configuration

The package will automatically register a service provider.

Next, you need to publish the Minions configuration file:

php artisan vendor:publish --provider="Minions\MinionsServiceProvider" --tag="config"

This is the default content of the config file that will be published as config/minions.php:

<?php

return [
    /*
     |--------------------------------------------------------------------------
     | Project ID
     |--------------------------------------------------------------------------
     |
     | Define the project ID of this application so any request by this app
     | will include the project id information allowing the server to
     | identify the source of a request.
     */

    'id' => 'minion-server',

    /*
     |--------------------------------------------------------------------------
     | Server Configuration
     |--------------------------------------------------------------------------
     |
     | Define the server configuration including port number, SSL support etc.
     |
     */

    'server' => [
        'host' => env('MINION_SERVER_HOST', '127.0.0.1'),
        'port' => env('MINION_SERVER_PORT', 8085),
        'secure' => env('MINION_SERVER_SECURE', false),
        'options' => [
            'tls' => array_filter([
                'local_cert' => env('MINION_SERVER_TLS_CERT', null),
                // 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_SERVER
            ]),
        ],
    ],


    /*
     |--------------------------------------------------------------------------
     | Projects
     |--------------------------------------------------------------------------
     |
     | List of applications this app will communicate with.
     |
     */

    'projects' => [
        'minion-client' => [
            'endpoint' => null,
            'token' => null,
            'signature' => null,
            'options' => [],
        ],
    ],
];

Installation for Client

To use Minions as client, you need to install the following via Composer:

composer require "clue/buzz-react=^2.5"

Installation for Server

To use Minions as client, you need to install the following via Composer:

composer require "react/http=^0.8.4"