descom/php-lib

适用于Descom的包

v1.0.4 2020-02-21 14:31 UTC

This package is auto-updated.

Last update: 2024-09-25 13:28:30 UTC


README

Build Status

安装

您可以通过composer安装此包

composer require descom/php-lib

发布包配置文件

php artisan vendor:publish --provider="DescomLib\DescomLibServiceProvider" --tag=config
  • 选择提供商:DescomLib\DescomLibServiceProvider

在config/descom_lib.php中插入token

通知管理服务

使用send方法,您可以向服务发送请求。

此方法需要$data参数。请参阅示例

事件

  • DescomLib\Services\NotificationManager\Events\NotificationFailed

示例数据

[
    'action' => 'loggedEmail',
    'data'   => [
        'email'        => 'test@example.com',
        'subscription' => 'example.com',
        'ip'           => '192.168.0.1',
        'geo'          => [
            'country' => [
                'name' => 'España',
                'iso'  => 'ES'
            ]
        ],
        'instance'=> [
            'hostname' => 'hostname',
            'name'     => 'DC/TEST/Linux/01',
        ],
        'dns'  => [
            'hostname'=> 'hostname.test.com',
            'domain'  => 'test.com',
        ]
    ]
]
[
    'action' => 'loggedEmailWithoutSSL',
    'data'   => [
        'email'        => 'test@example.com',
        'subscription' => 'example.com',
    ],
]

测试

composer test