Skip to content

Commit

Permalink
Update readme to show how to get the feed from the app
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljennings committed Mar 3, 2016
1 parent 56f309f commit 4f6dff6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $feed->markAsRead($notification);
## Navigation

- [Installation](#installation)
- [Using the Feed](#using-the-feed)
- [Setting Up Notifiable Models](#setting-up-notifiable-models)
- [Notifiable Groups](#notifiable-groups)
- [Available Methods](#available-methods)
Expand Down Expand Up @@ -67,6 +68,36 @@ The package comes with migrations to setup the default database structure. We re

To publish the migrations run `php artisan vendor:publish`.

## Using the Feed

Once installed you can access the feed in multiple ways.

Firstly you can dependency inject it from the IOC container by either the push or pull feed interfaces. Both interfaces will return the same instance, it's just to make your code more readable.

```php
public function __construct(
Michaeljennings\Feed\Contracts\PullFeed $pullFeed,
Michaeljennings\Feed\Contracts\PushFeed $pushFeed,
) {
$this->pullFeed = $pullFeed;
$this->pushFeed = $pushFeed;
}
```

Or you there is a helper method.

```php
$feed = feed();
```

Or if you want to use a facade you can register it in the aliases array in `config/app.php`.

```php
'aliases' => [
Michaeljennings\Feed\Facades\Feed::class
]
```

## Setting Up Notifiable Models

To set up a notifiable model you simply need to implement the notifiable interface and then use the notifiable trait.
Expand Down

0 comments on commit 4f6dff6

Please sign in to comment.