/**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $discountTypes = ['' => 'Select Discount Type', 'percentage' => 'Percentage', 'fixed' => 'Fixed'];
     $statuses = Discounts::$statuses;
     $products = Products::dropdownList($excludeDiscounted = true);
     return View::make('discounts.create', compact('discountTypes', 'products', 'statuses'));
 }
 /**
  * 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'));
 }