/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy(Pc_data $pd) { $psp = Pc_specs::where(array('pcid' => $pd->id)); $psp->delete(); $pmp = Pc_mants::where(array('pcid' => $pd->id)); $pmp->delete(); $pd->delete(); return Redirect::route('pc_datas.index')->with('mesage', 'Dato rimosso con successo'); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(Pc_data $pd, Pc_specs $ps) { $input = array_except(Input::all(), ['_method', '_token']); $ps->update($input); return Redirect::route('pc_datas.pc_specs.show', [$pd->slug, $ps->id])->with('message', 'Dati aggiornati con successo'); }