Ejemplo n.º 1
0
 /**
  * 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'));
 }
Ejemplo n.º 2
0
 /**
  *
  */
 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);
     }
 }
Ejemplo n.º 3
0
 /**
  * Get the widget data to send to the view
  * @return string
  */
 protected function data()
 {
     return ['categoryCount' => $this->category->all()->count()];
 }
Ejemplo n.º 4
0
 /**
  * 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');
 }