定制 siewwp/laravel-service-host 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

siewwp/laravel-service-host

Composer 安装命令:

composer require siewwp/laravel-service-host

包简介

laravel server-to-server service host with HMAC authentication

README 文档

README

Installation

composer require siewwp/laravel-service-host:^1.0.0

Publish service host config

php artisan vendor:publish --provider="Siewwp\LaravelServiceHost\ServiceHostServiceProvider" --tag="config"

Publish service host migration

php artisan vendor:publish --provider="Siewwp\LaravelServiceHost\ServiceHostServiceProvider" --tag="migrations"

Run migration

php artisan migrate

run the command below on console to create host

php artisan service-host:client {name} {webhook_url}

Guide

Authenticating client request

Add clients user provider in your auth.php configuration file.

'providers' => [
    'clients' => [
        'driver' => 'eloquent',
        'model' => Siewwp\LaravelServiceHost\Client::class,
    ],
],

Finally, you may use this provider in your guards configuration:

'guards' => [
    'client' => [
        'driver' => 'service-host',
        'provider' => 'clients',
    ],
],

Sending a webhook notification

To send notification, create a notification and specify WebhookChannel::class like below:

<?php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use Siewwp\LaravelServiceHost\Channels\WebhookChannel;

class InvoicePaid extends Notification
{
    public function via($notifiable)
    {
        return [WebhookChannel::class];
    }
    
    public function toWebhook($notifiable)
    {
        return [
            // ...
        ];
    }
    
    // ...
}

TODO

TEST

统计信息

  • 总下载量: 132
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固