New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

old-smoke-gun/lumen-yar

use yar extension in lumen
115

Larablocks Analysis

old-smoke-gun/lumen-yar works with any PHP project: the latest release (1.0.0, Apr 6, 2020) doesn't depend on Laravel.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • No release in the last 12 months (last: Apr 6, 2020)
  • 0 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Apr 6, 2020.
  • No releases in the last 12 months.
  • First released: Apr 6, 2020.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require old-smoke-gun/lumen-yar
Latest Version:1.0.0
PHP:^7.2.5
License:Apache-2.0
Last Updated:Apr 6, 2020
Links: GitHub  ·  Packagist
Maintainer: OldSmokeGun

yar 扩展在 lumen 框架中的简单封装

客户端

配置

  • config/service.php
<?php

return [
    'goods_service' => [
        'remote' => env('GOODS_SERVICE_REMOTE')
    ],
    'shop_service' => [
        'remote' => env('SHOP_SERVICE_REMOTE')
    ]
    // ...
];
  • bootstrap/app.php
$app->configure('service');

调用

try 
{

    $result = (new oldSmokeGun\Rpc\Client\Client(config('service.goods_service.remote'), 'Demo'))
        ->call('Foo', ['name' => 'bob']);

    dd($result);

} catch (Yar_Client_Exception $exception) {
    // TODO
}

服务器端

注意: 路由 /rpc/{service} 已被注册

配置

  • bootstrap/app.php
$app->register(oldSmokeGun\Rpc\Providers\RpcServiceProvider::class);

使用

  • App/Services 目录下新建 Demo.php
<?php

namespace App\Services;

class Demo
{
    public function foo()
    {
        return 'this is demo';
    }

}

Related Packages

rajeevsiewnath/lumen-react

Resource binding for easy model/resource maintainence

215
dusterio/lumen-passport

Making Laravel Passport work with Lumen

1,316,105 649
ersoy-insider/newrelic-custom-event

Sends custom events to newrelic insights

32,365 1
nomadnt/lumen-passport

Lumen porting of Laravel Passport

9,502 4
samfrm/lumen-passport

Making Laravel Passport work with Lumen

763 2

Version History

Version Released PHP License
1.0.0 ^7.2.5 Apache-2.0