Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
synergixe authored Oct 11, 2018
1 parent 0b33f1d commit e617fbe
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,8 @@ php artisan migrate
$user = \Auth::user();
$followee = User::where('id', '=', $request->input('followee_id'));

$follow = $user->followings()->save([
'follower_id' => $user->id,
'followee_id' => $followee->id
$follow = $user->follows()->attach([
$followee->id
]);

$event = new NotificableEvent(
Expand Down Expand Up @@ -320,14 +319,23 @@ php artisan migrate
return $this->email_address;
}

public function followings(){ // relation for all `followings`
public function follows(){ // relation for all `follows`

return $this->belongsToMany(User::class,
'social_network_follows',
'followee_id', 'follower_id', 'id', 'id', 'followings'
'followee_id', 'follower_id', 'id', 'id', 'follows'
)->withTimestamps();
}

public function followers(){ // relation for all `followers`

return $this->belongsToMany(User::class,
'social_network_follows',
'follower_id', 'followee_id', 'id', 'id', 'followers'
)->withTimestamps();

}

/* create the `makeDescription` method for trait { Describable } */

public function makeDecription(){
Expand Down Expand Up @@ -388,7 +396,7 @@ php artisan migrate
new ActivityStreamNotification(
$event->producer,
$event->reciever,
$event->timstamp,
$event->timestamp,
$event_kind
)
)->delay(
Expand Down

0 comments on commit e617fbe

Please sign in to comment.