PHPackages                             get-stream/stream-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. get-stream/stream-laravel

ActiveLibrary[API Development](/categories/api)

get-stream/stream-laravel
=========================

Build newsfeeds and activity feeds on Laravel using getstream.io

3.0.1(3y ago)327338.7k↓62.4%68[8 issues](https://github.com/GetStream/stream-laravel/issues)BSD-3-ClausePHPPHP &gt;=8.0CI passing

Since Oct 15Pushed 3y ago44 watchersCompare

[ Source](https://github.com/GetStream/stream-laravel)[ Packagist](https://packagist.org/packages/get-stream/stream-laravel)[ Docs](https://getstream.io/)[ RSS](/packages/get-stream-stream-laravel/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (6)Versions (42)Used By (0)

Stream Laravel
==============

[](#stream-laravel)

[![Build Status](https://camo.githubusercontent.com/23dbc0966f23474fbd4113102b4616202ec908ccc4becbcfcd48e0cdece6feb4/68747470733a2f2f7472617669732d63692e6f72672f47657453747265616d2f73747265616d2d6c61726176656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/GetStream/stream-laravel) [![PHP version](https://camo.githubusercontent.com/9d2dc3be56faed86e8d46015a39f282c57d232aa8bcd97d5cc7e49f8b46b8d31/68747470733a2f2f62616467652e667572792e696f2f70682f6765742d73747265616d25324673747265616d2d6c61726176656c2e737667)](http://badge.fury.io/ph/get-stream%2Fstream-laravel)

[stream-laravel](https://github.com/GetStream/stream-laravel) is a Laravel client for [Stream](https://getstream.io/). You can use this in any Laravel application, or in any application that uses Eloquent ORM ([`illuminate/database`](https://packagist.org/packages/illuminate/database)) as a standalone ORM.

You can sign up for a Stream account at [https://getstream.io/get\_started](https://getstream.io/get_started).

Note there is also a lower level [PHP - Stream integration](https://github.com/getstream/stream-php) library which is suitable for all PHP applications.

Build Activity Streams, News Feeds, and More
--------------------------------------------

[](#build-activity-streams-news-feeds-and-more)

[![](https://camo.githubusercontent.com/86b9b84c8e9abe92e94d6aad7cf60dd14516304714910497612a7c86fed89cf4/68747470733a2f2f6476716732646f6767676d6e362e636c6f756466726f6e742e6e65742f696d616765732f6d6f6f642d686f6d652e706e67)](https://camo.githubusercontent.com/86b9b84c8e9abe92e94d6aad7cf60dd14516304714910497612a7c86fed89cf4/68747470733a2f2f6476716732646f6767676d6e362e636c6f756466726f6e742e6e65742f696d616765732f6d6f6f642d686f6d652e706e67)

You can build:

- Activity Streams - like the one seen on GitHub
- A Twitter-like feed
- Instagram / Pinterest Photo Feeds
- Facebook-style newsfeeds
- A Notification System
- Lots more...

Demos
-----

[](#demos)

Installation
------------

[](#installation)

### Composer

[](#composer)

***Begin by installing this package through Composer. Edit your project's `composer.json` file to require `get-stream/stream-laravel`:***

```
"require": {
    "get-stream/stream-laravel": "~2.3.5"
},

```

***Next, update Composer:***

```
composer update

```

### Laravel

[](#laravel)

**Laravel prior to 5.5** (no longer supported)

Add `'GetStream\StreamLaravel\StreamLaravelServiceProvider'` to your list of providers in `config/app.php`:

```
'providers' => [
    GetStream\StreamLaravel\StreamLaravelServiceProvider::class,
    ...
],

```

And add the `FeedManager` facade `'GetStream\StreamLaravel\Facades\FeedManager'` to your list of aliases in `config/app.php`:

```
'aliases' => [
    'FeedManager' => GetStream\StreamLaravel\Facades\FeedManager::class,
    ...
],

```

***Publish the configuration file:***

```
php artisan vendor:publish --provider="GetStream\StreamLaravel\StreamLaravelServiceProvider"

```

This will create `config/stream-laravel.php`. We will set our credentials after they are created in the Stream Dashboard.

### GetStream.io Dashboard

[](#getstreamio-dashboard)

***Now, login to [GetStream.io](https://getstream.io) and create an application in the dashboard.***

***Retrieve the API key, API secret, and API app id, which are shown in your dashboard.***

***Create feeds in your new application. By default, you should create the following:***

- *user* which is a *flat* feed.
- *timeline* which is a *flat* feed.
- *timeline\_aggregated* which is an *aggregated* feed.
- *notification* which is a *notification* feed.

### Stream-Laravel Config File

[](#stream-laravel-config-file)

***Set your key, secret, and app id in `config/stream-laravel.php` file as their are shown in your dashboard. Also set the location for good measure. For example:***

```
return [

    /*
    |-----------------------------------------------------------------------------
    | Your GetStream.io API credentials (you can them from getstream.io/dashboard)
    |-----------------------------------------------------------------------------
    |
    */

    'api_key' => '[API KEY HERE]',
    'api_secret' => '[API SECRET HERE]',
    'api_app_id' => '[API APP ID HERE]',
    /*
    |-----------------------------------------------------------------------------
    | Client connection options
    |-----------------------------------------------------------------------------
    |
    */
    'location' => 'us-east',
    'timeout' => 3,
    /*
    |-----------------------------------------------------------------------------
    | The default feed manager class
    |-----------------------------------------------------------------------------
    |
    */

```

***You can also set the name of your feeds here:***

```
/*
    |-----------------------------------------------------------------------------
    | The feed that keeps content created by its author
    |-----------------------------------------------------------------------------
    |
    */
    'user_feed' => 'user',
    /*
    |-----------------------------------------------------------------------------
    | The feed containing notification activities
    |-----------------------------------------------------------------------------
    |
    */
    'notification_feed' => 'notification',
    /*
    |-----------------------------------------------------------------------------
    | The feeds that shows activities from followed user feeds
    |-----------------------------------------------------------------------------
    |
    */
    'news_feeds' => [
        'timeline' => 'timeline',
        'timeline_aggregated' => 'timeline_aggregated',
    ]

```

And that should get you off and running with Stream-Laravel. Have lots of fun!

### Lumen Installation

[](#lumen-installation)

Begin by installing this package through Composer.

```
composer require get-stream/stream-laravel

```

Add `'GetStream\StreamLaravel\StreamLumenServiceProvider'` to the list of providers in `bootstrap/app.php`

```
$app->register(\GetStream\StreamLaravel\StreamLumenServiceProvider::class);
```

Manually create a config file in ./config/stream-laravel.php...

```
