承接 fabmedia/laravel-slack-notifier 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fabmedia/laravel-slack-notifier

Composer 安装命令:

composer require fabmedia/laravel-slack-notifier

包简介

Slack Notifier is used to send messages in specific slack channel using slack webhook url.

README 文档

README

Laravel Slack Notifier is used to send messages in specific slack channel using slack webhook url.

Add your slack webhook url in .env file. Your webhook URL will look something like this:

SLACK_HOOK_URL="https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"

Installation

You can install the package via composer:

composer require "fabmedia/laravel-slack-notifier @dev"

Usage

You can send message by using the sendNotification method.

use Fabmedia\SlackNotifier\SlackNotifier;

$slackNotifier = new SlackNotifier();
$slackNotifier->sendNotification('This is a test message');

Alternatively, you could also send block message by using the sendNotificationBlock method.

use Fabmedia\SlackNotifier\SlackNotifier;


$block = [
	[
		'type' => 'section',
		'text' => [
			'type' => 'mrkdwn',
			'text' => '*A new visitor has submitted an inquiry*',
		],
	],
	[
		'type' => 'divider',
	],
	[
		'type' => 'section',
		'text' => [
			'type' => 'mrkdwn',
			'text' => "*Name:* {$name}",
		],
	],
	[
		'type' => 'section',
		'text' => [
			'type' => 'mrkdwn',
			'text' => "*Email:* {$email}",
		],
	],
	[
		'type' => 'section',
		'text' => [
			'type' => 'mrkdwn',
			'text' => "*Message:*\n{$message}",
		],
	],
];

$slackNotifier = new SlackNotifier();
$slackNotifier->sendNotificationBlock($block);

License

The MIT License (MIT). Please see LICENSE for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固