vanchaiy/line-sdk-php

LineBot & LineNotify SDK for Php pure & support laravel

1.0.3 2023-12-20 06:44 UTC

This package is auto-updated.

Last update: 2025-05-22 09:32:31 UTC


README

LineSDK for PHP

LineBot & LineNotify SDK for Pure PHP & Support Laravel


INSTALLATION

Run Composer in your project:

composer require vanchaiy/line-sdk-php

Then you could use SDK class after Composer is loaded on your PHP project:

require __DIR__ . '/vendor/autoload.php';

$lineNotify = new LineSDK\Bot();
$lineNotify = new LineSDK\Notify();

OR

use LineSDK\Bot();
use LineSDK\Notify();

Laravel Configuration

.env

LINE_BOT_CHANNEL_ID=
LINE_BOT_CHANNEL_SECRET=
LINE_BOT_CHANNEL_TOKEN=

LINE_NOTIFY_TOKEN=

config/app.php

    'providers' => [
        LineSDK\Laravel\LineServiceProvider::class,
    ],
    'aliases' => [
        'LineBot' => LineSDK\Laravel\Facades\LineBot::class,
        'LineNotify' => LineSDK\Laravel\Facades\LineNotify::class,
    ],

Run the following Artisan command in your terminal:

php artisan vendor:publish --provider="LineSDK\Laravel\LineServiceProvider"

Test

use LineBot;

LineBot::push('<userToken>')->text('LineBot Test');
use LineNotify;

LineNotify::sent()->text('LineNotify Test');

Documents