public function test_check_if_can_assign_a_parent_to_a_category()
 {
     $parentCategory = Category::create(['name' => 'Parent Test', 'active' => true]);
     $category = Category::create(['name' => 'Category Test', 'active' => true]);
     $category->parent()->associate($parentCategory)->save();
     $childCategory = $parentCategory->children->first();
     $this->assertEquals('Category Test', $childCategory->name);
     $this->assertEquals('Parent Test', $category->parent->name);
 }
 /**
  * @param Request $request
  * @param $id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy(Request $request, $id)
 {
     $this->repository->destroy($id);
     return redirect()->route('admin.categories.index');
 }