public function destroy($id) { $solucion = Solution::find($id); $solucion->delete(); $result = Result::find($solucion->results_id); $result->res_status = 0; $result->save(); return 'Elemento eliminado'; }
/** * @param $id * @param bool $withOrganizations * @return mixed * @throws GeneralException */ public function findOrThrowException($id, $withProject = false) { if ($withProject) { $result = Result::with('project')->find($id); } else { $result = Result::find($id); } if (!is_null($result)) { return $result; } throw new GeneralException('That result does not exist.'); }
public static function insertDocument($request) { $result = Result::find($request->results_id); $result->res_status = 1; $result->save(); $validacion = Validation::find($result->validations_id); $data = explode('|', $validacion->val_data); $documento = \Input::file('document'); $nombre = $result->res_referen . '_' . $data[0]; $dir = '../../public_html/clientes/ftp/' . Session::get('empresa') . '/pdf/'; if (null === $documento) { $documento->move($dir, $nombre); } $nombredoc = \DB::connection('master')->table('mdb_tipodocum')->where('doc_clave', $data[0])->first(); \DB::connection('users')->table('opauimg')->insert(['pk_referencia' => $result->res_referen, 'imgNameFile' => $nombre, 'strImageName' => $nombredoc->doc_nombre, 'imgtipo' => 'application/pdf', 'imgtipodoc' => $data[0]]); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $result = Result::find($id); if ($result->delete()) { //SE REGISTRA LA ACTIVIDAD EN LA BITACORA $this->binnacle("ElIMINÓ RESULTADO MENSUAL"); Session::flash('message', 'El resultado se eliminó correctamente'); } return Redirect::to('/result/'); }