1. Go to this page and download the library: Download get-stream/stream-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
class Pin extends Eloquent {
use GetStream\StreamLaravel\Eloquent\ActivityTrait;
class Pin extends Eloquent {
use GetStream\StreamLaravel\Eloquent\ActivityTrait;
public function author()
{
return $this->belongsTo('Author');
}
public function activityActorMethodName()
{
return 'author';
}
class Pin extends Eloquent {
use GetStream\StreamLaravel\Eloquent\ActivityTrait;
public function activityExtraData()
{
return ['is_retweet' => $this->is_retweet];
}
class Pin extends Eloquent {
use GetStream\StreamLaravel\Eloquent\ActivityTrait;
public function activityVerb()
{
return 'pin';
}
class Tweet extends Eloquent {
use GetStream\StreamLaravel\Eloquent\ActivityTrait;
public function activityNotify()
{
if ($this->isRetweet) {
$targetFeed = FeedManager::getNotificationFeed($this->parent->user->id);
return [$targetFeed];
}
}
class Follow extends Eloquent {
use GetStream\StreamLaravel\Eloquent\ActivityTrait;
public function target()
{
return $this->belongsTo('User');
}
public function activityNotify()
{
$targetFeed = FeedManager::getNotificationFeed($this->target->id);
return [$targetFeed];
}
use App\Transformers\MyModelEnrichTransformer;
use GetStream\StreamLaravel\Eloquent\ActivityTrait;
use Illuminate\Database\Eloquent\Model;
class MyModel extends Model
{
public function enrichTransformer() {
return new MyModelEnrichTransformer();
}
}