/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { // $bomhead = Bomhead::findOrNew($id); $parentItem = Item::findOrFail($id); $bomitems = Bomitem::latest('created_at')->where('parent_item_id', $id)->with('parentitem')->get(); return view('boms.edit', compact('bomhead', 'parentItem', 'bomitems')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // $parentid = Bomitem::find($id)->parent_item_id; Bomitem::destroy($id); return redirect('boms/' . $parentid . '/edit'); }