public function postEdit(CategoriesRequest $request, $id) { $term = Categories::find($id); $term->name = $request->name; $term->slug = Helpers::slug($request->slug); if (empty($term->slug)) { $term->slug = Helpers::slug($term->name); } $term->parent = $request->parent; $term->description = $request->description; if ($term instanceof Categories) { $term->save(); } return Redirect('admin/categories')->with('success', 'Update category successfully'); }