public function conclusiones_add($id) { $input = Input::all(); $rules = array('idreunion' => 'required', 'fecha' => 'required', 'idfecha' => 'required'); $validator = Validator::make($input, $rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator); } else { $category = new Reunion(); $category->codReunion = Input::get('idreunion'); $category->fecha = Input::get('fecha'); $category->idFecha = Input::get('idfecha'); $category->save(); return Redirect::to('/campeonato/detail/' . $id); } }
/** * Store a newly created resource in storage. * * @return Response */ public function store() { if (Request::ajax()) { $response = array(); $evento = new Evento(); $evento->start = Input::get('fecha_hora'); $evento->nombre = Input::get('nombre'); $evento->descripcion = Input::get('descripcion'); $evento->ambito_evento = Input::get('ambito_evento'); $evento->profesores_id = Auth::user()->id; if ($evento->validate()) { if (empty(Input::get('asunto'))) { $evento->save(); return Response::json(array('success' => true)); } else { $reunion = new Reunion(); $reunion->asunto = Input::get('asunto'); $reunion->descripcion = Input::get('descripcion_reunion'); if (empty(Input::get('ordinaria'))) { $reunion->ordinaria = 0; } else { $reunion->ordinaria = 1; } if ($reunion->validate()) { $evento->save(); $reunion->eventos_id = $evento->id; $reunion->save(); return Response::json(array('success' => true)); } else { return Response::json(array('success' => false, 'errores' => $reunion->errors()->toArray())); } } } else { return Response::json(array('success' => false, 'errores' => $evento->errors()->toArray())); } } else { return Response::json(array('success' => false)); } }