Skip to content

Commit ccdfa5d

Browse files
Christoph Rumpelirazasyed
authored andcommitted
Add more detailed instructions (#6)
* Add more detailed instructions I enhanced the given instructions to provide more details. * Update readme instructions
1 parent 4818bb8 commit ccdfa5d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Quality Score](https://img.shields.io/scrutinizer/g/laravel-notification-channels/facebook.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/facebook)
99
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/facebook.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/facebook)
1010

11-
This package makes it easy to send notifications using [Facebook](https://developers.facebook.com/docs/messenger-platform/product-overview) with Laravel 5.3.
11+
This package makes it easy to send notifications using the [Facebook Messenger](https://developers.facebook.com/docs/messenger-platform/product-overview) with Laravel 5.3.
1212

1313
## Contents
1414

@@ -37,26 +37,29 @@ You must install the service provider:
3737
```php
3838
// config/app.php
3939
'providers' => [
40+
// ...
4041
NotificationChannels\Facebook\FacebookServiceProvider::class,
4142
];
4243
```
4344

4445
## Setting up your Facebook Bot
4546

46-
Follow the [Getting Started](https://developers.facebook.com/docs/messenger-platform/quickstart) guide and get a page token.
47+
Follow the [Getting Started](https://developers.facebook.com/docs/messenger-platform/quickstart) guide in order to create a Facebook Messenger app, a Facebook page and a page token, which is connecting both.
4748

48-
Then, configure your Facebook Page Token:
49+
Next we need to add this token to our Laravel configurations. Create a new Facebook section inside `config/services.php` and place the page token there:
4950

5051
```php
5152
// config/services.php
53+
// ...
5254
'facebook' => [
5355
'page-token' => env('FACEBOOK_PAGE_TOKEN', 'YOUR BOT TOKEN HERE')
5456
]
5557
```
5658

5759
## Usage
5860

59-
You can now use the channel in your `via()` method inside the Notification class.
61+
Let's take an invoice-paid-notification as an example.
62+
You can now use the Facebook channel in your `via()` method, inside the InvoicePaid class. The `to($userId)` method defines the Facebook user, you want to send the notification to.
6063

6164
``` php
6265
use NotificationChannels\Facebook\FacebookChannel;
@@ -90,7 +93,7 @@ class InvoicePaid extends Notification
9093
}
9194
```
9295

93-
Here's a screenshot preview of the above notification on Facebook Messenger:
96+
The notification will be sent from your Facebook page, whose page token you have configured earlier. Here's a screenshot preview of the notification inside the chat window.
9497

9598
![Laravel Facebook Notification Example](https://cloud.githubusercontent.com/assets/1915268/17666125/58d6b66c-631c-11e6-9380-0400832b2e48.png)
9699

0 commit comments

Comments
 (0)