/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $suppliers = Supplier::where('status', 1)->lists('company_name', 'id'); $materials = Material::where('status', 1)->lists('name', 'id'); $purchase = Purchase::with('purchaseDetails')->findOrFail($id); return view('purchases.edit', compact('suppliers', 'materials', 'purchase')); }