Package Data | |
---|---|
Maintainer Username: | techinasia |
Maintainer Contact: | melvin@techinasia.com (Melvin Lee) |
Package Create Date: | 2016-12-08 |
Package Last Update: | 2017-02-06 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:24:01 |
Package Statistics | |
---|---|
Total Downloads: | 21 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 16 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Install this package with Composer:
composer require techinasia/laravel-stream
Register the service provider in your config/app.php
:
Techinasia\GetStream\StreamServiceProvider::class
[Optional] Register the facade in your config/app.php
, under aliases
:
'Stream' => Techinasia\GetStream\Facades\Stream::class
Publish all the vendor assets:
php artisan vendor:publish
This will create a file called stream.php
in the config
folder. Create an application via Stream's admin interface and copy the API key and secret to the configuration file.
You can add more applications by adding more key/secret pairs to the configuration file:
'applications' => [
'main' => [
'key' => 'key1',
'secret' => 'secret1',
],
'foo' => [
'key' => 'foo',
'secret' => 'bar',
],
],
use Techinasia\GetStream\Facades\Stream;
// Add an activity to a user feed via the default application.
$feed = Stream::feed('user', 1);
$feed->addActivity([
'actor' => 1,
'verb' => 'like',
'object' => 3,
'foreign_id' => 'post:42',
]);
// Add another activity to a user feed via another application.
$feed = Stream::application('another')->feed('user', 1);
$feed->addActivity([
'actor' => 1,
'verb' => 'like',
'object' => 3,
'foreign_id' => 'post:42',
]);
Please see CHANGELOG for more information for what has changed recently.
composer test
If you discover any security related issues, please email dev@techinasia.com instead of using the issues tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.