milyoona/microservice-sdk

Microservice SDK for lumen projects

This package's canonical repository appears to be gone and the package has been frozen as a result.

v2.5.3 2021-11-24 11:48 UTC

README

How to install

composer require milyoona/microservice-sdk
Register the Service Provider in bootstrap/app.php for Lumen:
$app->register(Milyoona\MicroserviceSdk\MicroserviceSdkServiceProvider::class);
Publish configuration files:
php artisan vendor:publish --tag=microservice-sdk
Set prefix in route for Lumen:
// Change the route in app.php
$app->router->group([
    'namespace' => 'App\Http\Controllers',
    'prefix' => 'v1'
], function ($router) {
    require __DIR__.'/../routes/web.php';
});

How to publish migrations

Set configs in config/consumer.php and Run this command

php artisan milyoona:install

php artisan migrate

How to consume messages

php artisan milyoona:consume

Use these directives for amqp configs in .env file

AMQP_HOST=
AMQP_PORT=
AMQP_USER=
AMQP_PASSWORD=

Use these directives for JWT configs in .env file

JWT_SECRET=GKPMVOCKpMCDJQ3GprVA0EfTKGJiTEAImjeKN009Vndls6oRD6raawkRzDoB97AI
JWT_LIFETIME=2

Use these directives for backup database in .env file

DB_HOST_BACKUP=
DB_PORT_BACKUP=
DB_DATABASE_BACKUP=
DB_USERNAME_BACKUP=
DB_PASSWORD_BACKUP=

How to sync database

php artisan milyoona:sync