You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
693 B
25 lines
693 B
<?php |
|
namespace App\Class; |
|
|
|
class LineNotify |
|
{ |
|
public static function send($message) |
|
{ |
|
$token = 'VAClbvaOmpmnIcmDrVVVkDLS51BWaZ6JQ7udePUSY8J'; |
|
$header = array( |
|
'Content-Type: multipart/form-data', |
|
'Authorization: Bearer ' . $token |
|
); |
|
$message = array( |
|
'message' => $message |
|
); |
|
$ch = curl_init(); |
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); |
|
curl_setopt($ch, CURLOPT_URL, 'https://notify-api.line.me/api/notify'); |
|
curl_setopt($ch, CURLOPT_POST, true); |
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $message); |
|
|
|
$result = curl_exec($ch); |
|
curl_close($ch); |
|
} |
|
}
|
|
|