Example #1
0
 /**
  * Edit the given task.
  *
  * @param  Request  $request
  * @param  Task  $task
  * @return Response
  */
 public function edit(Request $request, Post $post)
 {
     $this->authorize('blog', Auth::user());
     $categories = $post->getCategoriesCommaSeparated();
     $tags = $post->getTagsCommaSeparated();
     $bestCat = Category::with('postCount')->get()->sortByDesc('postCount');
     $bestTag = Tag::with('postCount')->get()->sortByDesc('postCount');
     return view('maikblog::edit', ['post' => $post, 'categories' => $categories, 'tags' => $tags, 'best_cat' => $bestCat, 'best_tag' => $bestTag]);
 }