Rubenwouters\CrmLauncher\Updates\UpdateAllCases::getPosts PHP Метод

getPosts() приватный Метод

Return all facebook posts (merges messages & publishments)
private getPosts ( ) : [type]
Результат [type]
    private function getPosts()
    {
        $collection = collect();
        $messages = $this->message->with(['caseOverview' => function ($query) {
            $query->where('status', '!=', '2')->where('origin', 'Facebook post');
        }])->where('fb_post_id', '!=', '')->where('fb_reply_id', '')->where('fb_private_id', '')->get();
        $publishments = $this->publishment->facebookPosts();
        foreach ($messages as $key => $message) {
            $collection->push($message);
        }
        foreach ($publishments as $key => $publishment) {
            $collection->push($publishment);
        }
        return $collection;
    }