定制 notification-custom-line-channel/line-bot 二次开发

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

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

notification-custom-line-channel/line-bot

最新稳定版本:v1.0.0

Composer 安装命令:

composer require notification-custom-line-channel/line-bot

包简介

Line Messaging API Notification Service notification channel for Laravel.

README 文档

README

このパッケージは、Laravelを使用して Line Messaging API を利用したプッシュメッセージ送信を簡単にできるようにします。 将来的には、よりMessaging APIを活用した機能が追加される可能性があります。

インストール

このパッケージは Composer を使用してインストールできます:

composer require notification-custom-line-channel/line-bot --update-with-dependencies

セットアップ

Line Messaging APIのチャネルアクセストークンを追加してください config/services.php:

<?php

return [

    // ...

    'line-bot' => [
        'channel_access_token' => env('LINE_CHANNEL_ACCESS_TOKEN'),
    ],

];

使用方法

通知内の via() メソッドでこのチャンネルを使用できます。 以下はサンプルコードになります:

<?php

namespace App\Http\Controllers;

use App\Models\User;
use NotificationChannels\Line\LineChannel;
use NotificationChannels\Line\LineMessage;
use Illuminate\Notifications\Notification;

/**
 * Sample Code.
 */
class TestController extends Controller
{
    public function notifyToUser()
    {
        $user = new User();
        $user->notify(new LineNotification());
    }
}

class LineNotification extends Notification
{
    public function via($notifiable)
    {
        return [LineChannel::class];
    }

    public function toLine($notifiable)
    {
        return LineMessage::create(
            'line_user_id',
            'Hello world.'
        );
    }
}

テスト

$ composer test

Security

セキュリティに関する問題を発見した場合、Issue トラッカーを使用せずに contact@eslo.jp にメールでご連絡ください。

ライセンス

詳細については License File をご覧ください。

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-09