Exemple #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $item = Item::whereId($id)->firstOrFail();
     $name = $item->name;
     $item->delete();
     return redirect()->route('items.index')->with('status', 'The item ' . $name . ' has been deleted!');
 }
 public function updatebulkPackaging($item_id)
 {
     $iteminfo = Item::whereId($item_id)->first();
     $id = Request::input('id');
     $bulkid = BulkPackaging::where('id', $id)->first();
     $getBaseUnitid = count(BulkUnit::where('id', $bulkid->uom_id)->get());
     if ($getBaseUnitid > 0) {
         return redirect()->action('Operations\\ItemController@itemProfile', $item_id)->with('message', 'cannot be update');
     } else {
         $updateBulk = BulkPackaging::where('id', $id)->first();
         $input = Input::except('_token');
         $updateBulk->fill($input);
         $updateBulk->save();
         return redirect()->action('Operations\\ItemController@itemProfile', $item_id)->with('message', 'Bulk Packaging  updated');
     }
 }