katsana / minions-polyfill
Minions 组件服务器(Polyfill)使用 Laravel 路由
v1.2.1
2020-09-08 01:07 UTC
Requires
- illuminate/http: ^6.0 || ^7.0 || ^8.0
- katsana/minions: ^1.7 || ^2.3
Requires (Dev)
- clue/block-react: ^1.3
- orchestra/canvas: ^4.5 || ^5.0 || ^6.0
- orchestra/testbench-dusk: ^4.6 || ^5.0 || ^6.0
README
安装
Minions 可以通过 composer 安装
composer require "katsana/minions-polyfill=^1.0"
请确保您已经安装了 Minions 并查阅了 安装和配置文档。
使用方法
要使用 Laravel 路由处理 RPC 请求,您只需设置 URI 和 TLD 域名来处理请求。为此,此包已经为 Illuminate\Routing\Router
添加了一个宏。
建议您将命令添加到 App\Providers\RouteServiceProvider::map()
方法中。
<?php namespace App\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { // ... /** * Define your route model bindings, pattern filters, etc. * * @return void */ public function boot() { Route::minion('rpc'); parent::boot(); } // ... }
您还可以使用以下方法将其设置为特定域名:
Route::minion('/', 'rpc.your-domain');