Example #1
0
 public function addObservacion()
 {
     $input = Request::createFromGlobals();
     $record = AccionObservacion::create($input->all());
     // Notificar usuario creador
     $accion = Accion::with('observaciones')->find($input->accion_id);
     $user = User::find($accion->observaciones[0]->responsable);
     $observacion = $record;
     $html = view('Reclamos.Emails.new_action_comment', compact('user', 'accion', 'observacion'));
     echo '<pre>';
     print_r($html);
     echo '</pre>';
     die;
     MailController::sendGeneralMail([["email" => $user->user_email]], "Nuevo comentario en acción correctiva/preventiva", $html);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $record = AccionObservacion::find($id)->delete();
     return new AjaxResponse('success', '');
 }