kylewlawrence/laravel-betterstack-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

kylewlawrence/laravel-betterstack-api

Composer 安装命令:

composer require kylewlawrence/laravel-betterstack-api

包简介

Laravel API for BetterStack

README 文档

README

This package provides integration with the BetterStack API. It currently only supports sending a chat message.

Installation

You can install this package via Composer using:

composer require kylewlawrence/laravel-betterstack-api

The facade is automatically installed.

BetterStack::get('zones', ['per_page' => 100]);

Configuration

To publish the config file to app/config/betterstack-laravel.php run:

php artisan vendor:publish --provider="KyleWLawrence\BetterStack\Providers\BetterStackServiceProvider"

Set your configuration using environment variables, either in your .env file or on your server's control panel:

  • BETTERSTACK_TOKEN

The API access token. You can create one as described here: https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/multiple-tokens/

  • BETTERSTACK_DRIVER (Optional)

Set this to null or log to prevent calling the BetterStack API directly from your environment.

Contributing

Pull Requests are always welcome here. I'll catch-up and develop the contribution guidelines soon. For the meantime, just open and issue or create a pull request.

Usage

Facade

The BetterStack facade acts as a wrapper for an instance of the BetterStack\Http\HttpClient class.

Dependency injection

If you'd prefer not to use the facade, you can instead inject KyleWLawrence\BetterStack\Services\BetterStackService into your class. You can then use all of the same methods on this object as you would on the facade.

<?php

use KyleWLawrence\BetterStack\Services\BetterStackService;

class MyClass {

    public function __construct(BetterStackService $betterstack_service) {
        $this->betterstack_service = $betterstack_service;
    }

    public function listZones() {
        return $this->betterstack_service->get('dnszone', ['perPage' => 100]);
    }

}

This package is available under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-26