定制 razorpay/slack-laravel 二次开发

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

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

razorpay/slack-laravel

Composer 安装命令:

composer require razorpay/slack-laravel

包简介

Laravel 4 and 5 integration for the razorpay/slack package, including facades and service providers.

关键字:

README 文档

README

This package allows you to use Slack for PHP easily and elegantly in your Laravel 4 or 5 app. Read the instructions below to get setup, and then head on over to Slack for PHP for usage details.

Requirements

Laravel 4 or 5.

Installation

You can install the package using the Composer package manager. You can install it by running this command in your project root:

composer require razorpay/slack-laravel

Then create an incoming webhook for each Slack team you'd like to send messages to. You'll need the webhook URL(s) in order to configure this package.

Laravel 5

Add the Razorpay\Slack\Laravel\ServiceProvider provider to the providers array in config/app.php:

'providers' => [
  Razorpay\Slack\Laravel\ServiceProvider::class,
],

Then add the facade to your aliases array:

'aliases' => [
  ...
  'Slack' => Razorpay\Slack\Laravel\Facade::class,
],

Finally, publish the config file with php artisan vendor:publish. You'll find it at config/slack.php.

Laravel 4

Add the Razorpay\Slack\Laravel\ServiceProvider provider to the providers array in app/config.php:

'providers' => [
  ...
  'Razorpay\Slack\Laravel\ServiceProvider',
],

Then add the facade to your aliases array:

'aliases' => [
  ...
  'Slack' => 'Razorpay\Slack\Laravel\Facade',
],

Finally, publish the config file with php artisan config:publish razorpay/slack. You'll find the config file at app/config/packages/razorpay/slack-laravel/config.php.

Configuration

The config file comes with defaults and placeholders. Configure at least one team and any defaults you'd like to change.

Usage

The Slack facade is now your interface to the library. Any method you see being called an instance of Razorpay\Slack\Client is available on the Slack facade for easy use.

Note that if you're using the facade in a namespace (e.g. App\Http\Controllers in Laravel 5) you'll need to either use Slack at the top of your class to import it, or append a backslash to access the root namespace directly when calling methods, e.g. \Slack::method().

// Send a message to the default channel
Slack::send('Hello world!');

// Send a message to a different channel
Slack::to('#accounting')->send('Are we rich yet?');

// Send a private message
Slack::to('@username')->send('psst!');

Now head on over to Slack for PHP for more examples, including attachments and message buttons.

Migrating to 2.0

Version 2.0 adds support for multiple slack clients. For migrating 1.X to 2.0, nest all the configuration properties inside defaults key in the configuration file. Configuration for additional clients can be specified in the clients property.

[
    'is_slack_enabled'  =>  true,
    'defaults'    =>  [
        // default slack client configuration.
    ],
    
    clients =>  [
        // Additional slack clients configuration
        'client1'   =>  [
            
        ]
    ]
]

razorpay/slack-laravel 适用场景与选型建议

razorpay/slack-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 376.13k 次下载、GitHub Stars 达 18, 最近一次更新时间为 2017 年 03 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「slack」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 razorpay/slack-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 razorpay/slack-laravel 我们能提供哪些服务?
定制开发 / 二次开发

基于 razorpay/slack-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 376.13k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 2

GitHub 信息

  • Stars: 18
  • Watchers: 61
  • Forks: 111
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2017-03-11