PHP code example of phattarachai / line-notify

1. Go to this page and download the library: Download phattarachai/line-notify library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phattarachai / line-notify example snippets


use Phattarachai\LineNotify\Facade\Line;

Line::send('message');

use Phattarachai\LineNotify\Facade\Line;

Line::setToken(/*...access token */)
    ->send('message');

Line::imageUrl('https://lorempixel.com/1024/1024/')
    ->send('message');

Line::thumbnailUrl('https://lorempixel.com/240/240/')
    ->imageUrl('https://lorempixel.com/1024/1024/')
    ->send('message');

Line::imagePath('/path/to/your/image.png')
    ->send('message');

Line::thumbnailUrl('https://lorempixel.com/240/240/')
    ->imageUrl('https://lorempixel.com/1024/1024/')
    ->imagePath('/path/to/your/image.png')
    ->send('message');

Line::sticker(1, 138)
    ->send('message');

// File: /config/line-notify.php
return [
    'access_token' => env('LINE_ACCESS_TOKEN'),
];

'providers' => [
    /*
     * Package Service Providers...
     */
    Phattarachai\LineNotify\LineNotifyServiceProvider::class,
]

use Phattarachai\LineNotify\Line;

$line = new Line('YOUR-API-TOKEN-HERE');
$line->send('message');

php artisan vendor:publish --provider="Phattarachai\LineNotify\LineNotifyServiceProvider"