-
Notifications
You must be signed in to change notification settings - Fork 166
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
Showing
9 changed files
with
236 additions
and
37 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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace NotificationChannels\Telegram\Tests\TestSupport; | ||
|
||
use Illuminate\Notifications\Notification; | ||
use NotificationChannels\Telegram\TelegramContact; | ||
|
||
/** | ||
* Class TestContactNotification. | ||
*/ | ||
class TestContactNotification extends Notification | ||
{ | ||
/** | ||
* @param $notifiable | ||
* @return TelegramContact | ||
*/ | ||
public function toTelegram($notifiable): TelegramContact | ||
{ | ||
return TelegramContact::create() | ||
->to(12345) | ||
->phoneNumber('123456789') | ||
->firstName('John') | ||
->lastName('Doe') | ||
->vCard('vCard'); | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
namespace NotificationChannels\Telegram\Tests\TestSupport; | ||
|
||
use Illuminate\Notifications\Notification; | ||
use NotificationChannels\Telegram\TelegramLocation; | ||
|
||
/** | ||
* Class TestLocationNotification. | ||
*/ | ||
class TestLocationNotification extends Notification | ||
{ | ||
public function __construct( | ||
private float|string $latitude, | ||
private float|string $longitude | ||
) { | ||
} | ||
|
||
/** | ||
* @param $notifiable | ||
* @return TelegramLocation | ||
*/ | ||
public function toTelegram($notifiable): TelegramLocation | ||
{ | ||
return TelegramLocation::create() | ||
->to(12345) | ||
->latitude($this->latitude) | ||
->longitude($this->longitude) | ||
->options(['horizontal_accuracy' => 100]); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace NotificationChannels\Telegram\Tests\TestSupport; | ||
|
||
use Illuminate\Notifications\Notification; | ||
use NotificationChannels\Telegram\TelegramPoll; | ||
|
||
/** | ||
* Class TestPollNotification. | ||
*/ | ||
class TestPollNotification extends Notification | ||
{ | ||
/** | ||
* @param $notifiable | ||
* @return TelegramPoll | ||
*/ | ||
public function toTelegram($notifiable): TelegramPoll | ||
{ | ||
return TelegramPoll::create() | ||
->to(12345) | ||
->question("Isn't Telegram Notification Channel Awesome?") | ||
->choices(['Yes', 'No']); | ||
} | ||
} |