/**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $types = Types::dropdownList();
     $units = Units::dropdownList();
     $suppliers = Suppliers::dropdownList();
     return View::make('products.create', compact('types', 'units', 'suppliers'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     if (!$id) {
         return Redirect::route('stocks.index')->with('error', 'Please Provide Stock id');
     }
     $stock = Stocks::find($id);
     if (empty($stock)) {
         return Redirect::route('stocks.index')->with('error', 'Stock not found');
     }
     $suppliers = Suppliers::dropdownList();
     $products = Products::dropdownList();
     return View::make('stocks.edit', compact('stock', 'suppliers', 'products'));
 }