kittinan / php-line-notify
PHP Line Notify
Installs: 34 414
Dependents: 1
Suggesters: 0
Security: 0
Stars: 46
Watchers: 12
Forks: 41
Open Issues: 1
Requires
- php: >=5.5
- guzzlehttp/guzzle: >=6.2.2
Requires (Dev)
- phpunit/phpunit: 4.8.12
- satooshi/php-coveralls: dev-master
README
Simple PHP Line Notify Class
Requirement
- PHP 5.5+
- guzzlehttp
Composer
Install the latest version with composer
composer require kittinan/php-line-notify
https://packagist.org/packages/kittinan/php-line-notify
Generate Line Notify Token
https://notify-bot.line.me/my/
Usage
Example : notify text message
$token = 'YOUR LINE NOTIFY TOKEN'; $ln = new KS\Line\LineNotify($token); $text = 'Hello Line Notify'; $ln->send($text);
Example : notify text with image
$text = 'Hello Line Notify'; $image_path = '/YOUR/IMAGE/PATH'; //Line notify allow only jpeg and png file $ln->send($text, $image_path); //HTTP or HTTPS image path $image_path = 'https://lorempixel.com/800/600/'; //Line notify allow only jpeg and png file $ln->send($text, $image_path);
Example : notify text with sticker
See sticker list https://devdocs.line.me/files/sticker_list.pdf
$text = 'Hello Sticker'; $sticker = ['stickerPackageId' => '1', 'stickerId' => '401']; $ln->send($text, null, $sticker);
Screenshot
License
The MIT License (MIT)