コード例 #1
0
ファイル: BomsController.php プロジェクト: seahouse/la514test
 /**
  * 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'));
 }
コード例 #2
0
 /**
  * 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');
 }