/** * Remove the specified resource from storage. * DELETE /wares/{id} * * @param int $id * @return Response */ public function destroy($id) { Ware::find($id)->delete(); return Redirect::back(); }
public function ajaxCart() { $ware = Ware::find(Input::get('wareId')); Cart::associate('Ware')->add(['id' => Input::get('wareId'), 'name' => $ware->title, 'qty' => 1, 'price' => $ware->price - $ware->discount]); return Cart::count(); }