/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($venda_id, $id) { $venda_item = VendaItem::find($id); $venda_item::destroy($id); Produto::addEstoque($venda_item->produto_id, $venda_item->quantidade); $total_venda = Venda::totalVenda($venda_id); $total = $total_venda[0]->total != null ? $total_venda[0]->total : '0,00'; $dados = ['total' => $total]; return $dados; }