royalmar/laravel-line-notify

此包最新版本(1.0.1)没有可用的许可信息。

laravel 的 LINE Notify

1.0.1 2019-10-30 08:12 UTC

This package is not auto-updated.

Last update: 2024-09-25 19:55:44 UTC


README

在 Laravel 中实现 Line Notify (Notification) 套件

如何安装

composer require royalmar/laravel-line-notify

Laravel 设置

将服务提供者添加到 config/app.php

'providers' => [
    ...
    Royalmar\LineNotify\Providers\LineNotifyServiceProvider::class,
    ...

将别名添加到 config/app.php

'aliases' => [
    ...
    'LineNotify' => Royalmar\LineNotify\Facades\LineNotify::class,
    ...

使用自定义配置

php artisan vendor:publish --tag="line_notify_install"

用法

发送文本消息

LineNotify::sendMessage('{accessToken}', 'test massage');

发送文本消息和图片

LineNotify::sendMessageAndImage('{accessToken}', 'test massage', [
            'imageThumbnail' => 'https://asnanak.net/site/wp-content/uploads/2012/10/source_27_waves_dark_green-240x240.jpg',
            'imageFullsize' => 'https://asnanak.net/site/wp-content/uploads/2012/10/source_27_waves_dark_green-1024x768.jpg'
        ]);

发送文本消息和贴纸

LineNotify::sendMessageAndSticker('{accessToken}', 'test massage', [
            'stickerPackageId' => 1,
            'stickerId' => 10
        ]);

限制与 Business Connect API 相同,参考:https://developers.line.me/businessconnect/api-reference#sending_message