This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e6263e
commit 98a29c3
Showing
8 changed files
with
93 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/vendor | ||
|
||
composer.lock | ||
composer.lock | ||
.phpunit* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
## Laravel Notifications for LINE Notify ![Build Status](https://github.com/moririnson/laravel-line-notify/workflows/PHP%20Composer/badge.svg) | ||
|
||
#### Requirement | ||
|
||
- PHP 7.0+ | ||
- Laravel 5.3+ | ||
|
||
#### Installation | ||
|
||
```bash | ||
composer require moririnson/laravel-line-notify | ||
``` | ||
|
||
#### Usage | ||
|
||
```php | ||
/** | ||
* @return string token | ||
*/ | ||
public function routeNotificationForLINE() | ||
{ | ||
return 'ACCESS_TOKEN_HERE'; | ||
} | ||
``` | ||
|
||
```php | ||
|
||
use Illuminate\Notifications\Notification; | ||
use Moririnson\LINENotify\Channels\LINENotifyChannel; | ||
use Moririnson\LINENotify\Messages\LINENotifyMessage; | ||
|
||
class LineNotify extends Notification | ||
{ | ||
private $message; | ||
|
||
public function __construct($message) | ||
{ | ||
$this->message = $message; | ||
} | ||
|
||
public function via($notifiable) | ||
{ | ||
return [LINENotifyChannel::class] | ||
} | ||
|
||
public function toLINE($notifiable) | ||
{ | ||
return (new LINENotifyMessage())->message($this->message); | ||
} | ||
} | ||
``` | ||
|
||
#### Testing | ||
|
||
```bash | ||
composer test | ||
``` | ||
|
||
#### License | ||
|
||
The MIT License (MIT), Please see [License File](./LICENSE.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<?php | ||
|
||
namespace Moririnson\LineNotify\Test; | ||
namespace Moririnson\LINENotify\Tests\Messages; | ||
|
||
use Moririnson\LineNotify\Messages\LineNotifyMessage; | ||
use Moririnson\LINENotify\Messages\LINENotifyMessage; | ||
use Orchestra\Testbench\TestCase; | ||
|
||
class LineMessageTest extends TestCase | ||
{ | ||
public function testMessage() | ||
{ | ||
$expected = 'test'; | ||
$message = (new LineNotifyMessage())->message($expected); | ||
$message = (new LINENotifyMessage())->message($expected); | ||
$this->assertEquals($expected, $message->message); | ||
|
||
$this->message = new LineNotifyMessage($expected); | ||
$this->message = new LINENotifyMessage($expected); | ||
$this->assertEquals($expected, $message->message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters