/** * @param $id * @return \BladeView|bool|\Illuminate\View\View */ public function getEdit($id) { $category = Categories::find($id); $id_parent = $category->parent; $terms = Categories::select('id', 'name', 'parent')->get()->toArray(); $terms = Helpers::buildTree($terms); return view('admin.categories.edit', compact('id_parent', 'terms', 'category')); }