/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\category\EditFormRequest $request, $id)
 {
     $data = categories::findorfail($id);
     if ($request->get('parent_id')) {
         $data->name = $request->get('name');
         $data->per_pound_price = $request->get('per_pound');
         $data->parent_id = $request->get('parent_id');
         $data->short_description = $request->get('short_description');
         $data->detail_description = $request->get('detail_description');
         $data->is_active = $request->get('is_active');
         $data->save();
         return redirect()->route('flavor/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The selected flavor item update']));
     } else {
         return redirect()->route('flavor/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_WARNING', ['message' => 'Whoops, looks like something went wrong.']));
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\category\EditFormRequest $request, $id)
 {
     $offers = categories::findorfail($id);
     if ($request->get('parent_id')) {
         $offers->name = $request->get('name');
         $offers->parent_id = $request->get('parent_id');
         $offers->short_description = $request->get('short_description');
         $offers->detail_description = $request->get('detail_description');
         $offers->is_active = $request->get('is_active');
         $offers->save();
         return redirect()->route('parent_offers/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The selected offers update']));
     } else {
         return redirect()->route('parent_offers/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_WARNING', ['message' => 'Sorry something went Wrong']));
     }
 }