/** * @return array */ private function getOverviewData() { $archive = $this->post->where('publish_date', '<=', date('Y-m-d H:i:s'))->orderBy('publish_date', 'DESC')->get()->groupBy(function ($query) { return Carbon::parse($query->publish_date)->format('F Y'); }); $data = ['categories' => $this->category->all(), 'tags' => $this->tag->all(), 'archives' => $archive]; return $data; }
/** * Get the default data for the * create and edit view * * @param $post * @return array */ private function getViewData($post = null) { return ['reviewers' => $this->user->reviewers(), 'statuses' => $this->status->all(), 'categories' => $this->category->all(), 'visibility' => $this->visibility->all(), 'publish_date' => Carbon::now()->format('d-m-Y H:i'), 'post' => $post]; }