public function destroy($id) { // $son = Category::where('parent_id', '=', $id)->get()->toArray(); if (!empty($son)) { Notification::error('请先删除下级分类'); return redirect()->route('backend.cate.index'); } if (Category::destroy($id)) { Notification::success('删除成功'); return redirect()->route('backend.cate.index'); } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $count = Category::destroy($id); if ($count > 0) { return returnData(true, [], true); } return returnData(false, [], true); }
public function destroy($id) { Category::destroy($id); Cache::store('category')->flush(); return ['error' => 0, 'message' => '删除成功!']; }