public function update(Request $request, $slug)
 {
     $category = Category::whereSlug($slug)->firstOrFail();
     $this->authorize('laraboard::category-edit', $category);
     $this->validate($request, ['name' => 'required|max:255', 'body' => 'max:255']);
     //  category names must be unique
     if (Category::whereName(strip_tags($request->name))->where('id', '!=', $category->id)->count() > 0) {
         return redirect()->back()->withInput()->with('danger', 'Category names must be unique.');
     }
     $category->name = $request->name;
     $category->body = $request->body;
     $category->user_id = \Auth::user()->id;
     $category->save();
     return redirect()->route('forum.index')->with('success', 'Category updated successfully.');
 }