예제 #1
0
 public function group($group)
 {
     $user = Auth::user();
     $streams = Stream::where('parentable_type', 'App\\Group')->where('parentable_id', $group->id)->where('user_id', $user->id)->latest()->get();
     foreach ($streams as $stream) {
         if ($stream->contentable_type == 'App\\Post') {
             $this->feed[] = $this->postGroup($stream->contentable);
         } elseif ($stream->contentable_type == 'App\\Problem') {
             $this->feed[] = $this->problem($stream->contentable);
         }
     }
     return $this->feed;
 }