Exemplo n.º 1
0
 private function stream($recommendation)
 {
     $authUser = Auth::user();
     $user = $recommendation->skill->user;
     $friendRepository = new FriendRepository();
     $friends = $friendRepository->friendsOf($user->id);
     foreach ($friends as $friend) {
         $is_see = 0;
         if ($authUser->id == $friend->friend_info->id) {
             $is_see = 1;
         }
         Stream::create(['user_id' => $friend->friend_info->id, 'edge_ranke' => 0, 'contentable_id' => $recommendation->id, 'contentable_type' => 'App\\Recommendation', 'parentable_id' => $authUser->id, 'parentable_type' => 'App\\User', 'is_see' => $is_see]);
     }
     Stream::create(['user_id' => $user->id, 'edge_ranke' => 0, 'contentable_id' => $recommendation->id, 'contentable_type' => 'App\\Recommendation', 'parentable_id' => $authUser->id, 'parentable_type' => 'App\\User', 'is_see' => 0]);
 }
Exemplo n.º 2
0
 public function friends()
 {
     $friendRepository = new FriendRepository();
     return $friendRepository->friendsOf($this->attributes['id']);
 }
Exemplo n.º 3
0
 /**
  * Created By Dara on 22/12/2015
  * user-friend admin control
  */
 public function adminFriendIndex(User $user, FriendRepository $friendRepository)
 {
     $friends = $friendRepository->friendsOf($user->id);
     return view('admin.friend.index', compact('friends', 'user'))->with(['title' => 'Friends Management']);
 }