/** * Show the form for editing the specified resource. * * @param Post $post * @return \Illuminate\View\View */ public function edit(Post $post) { $thumbnail = $this->file->findFileByZoneForEntity('thumbnail', $post); $categories = $this->category->allTranslatedIn(app()->getLocale()); $statuses = $this->status->lists(); return view('blog::admin.posts.edit', compact('post', 'categories', 'thumbnail', 'statuses')); }
/** * */ private function emptyBlogTables() { foreach ($this->post->all() as $post) { $this->post->destroy($post); } foreach ($this->category->all() as $category) { $this->category->destroy($category); } foreach ($this->tag->all() as $tag) { $this->tag->destroy($tag); } }
/** * Get the widget data to send to the view * @return string */ protected function data() { return ['categoryCount' => $this->category->all()->count()]; }
/** * Remove the specified resource from storage. * * @param Category $category * @return Response */ public function destroy(Category $category) { $this->category->destroy($category); flash(trans('blog::messages.category deleted')); return redirect()->route('admin.blog.category.index'); }