Skip to content

Commit 0a55c36

Browse files
authored
Add usage in Lumen instructions (#125)
* Add instructions for usage in Lumen * Fix proxy support content url
1 parent b82e2eb commit 0a55c36

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This package makes it easy to send Telegram notification using [Telegram Bot API
1313

1414
- [Installation](#installation)
1515
- [Setting up your Telegram bot](#setting-up-your-telegram-bot)
16+
- [Using in Lumen](#using-in-lumen)
17+
- [Proxy or Bridge Support](#proxy-or-bridge-support)
1618
- [Usage](#usage)
1719
- [Text Notification](#text-notification)
1820
- [Attach a Photo](#attach-a-photo)
@@ -49,13 +51,29 @@ Talk to [@BotFather](https://core.telegram.org/bots#6-botfather) and generate a
4951
Then, configure your Telegram Bot API Token:
5052

5153
```php
52-
// config/services.php
54+
# config/services.php
55+
5356
'telegram-bot-api' => [
5457
'token' => env('TELEGRAM_BOT_TOKEN', 'YOUR BOT TOKEN HERE')
5558
],
5659
```
5760

58-
#### (Optional) Proxy or Bridge Support
61+
## Using in Lumen
62+
63+
If you're using this notification channel in your Lumen project, you will have to add the below code in your `bootstap/app.php` file.
64+
65+
```php
66+
# bootstrap/app.php
67+
68+
// Make sure to create a "config/services.php" file and add the config from the above step.
69+
$app->configure('services');
70+
71+
# Register the notification service providers.
72+
$app->register(Illuminate\Notifications\NotificationServiceProvider::class);
73+
$app->register(NotificationChannels\Telegram\TelegramServiceProvider::class);
74+
```
75+
76+
## Proxy or Bridge Support
5977

6078
You may not be able to send notifications if Telegram Bot API is not accessible in your country,
6179
you can either set a proxy by following the instructions [here](http://docs.guzzlephp.org/en/stable/quickstart.html#environment-variables) or

0 commit comments

Comments
 (0)