Exemplo n.º 1
0
 public function aluSave(Request $request)
 {
     $alumno = new Alumno();
     $alumno->alu_nombre = $request->get('alu_nombre');
     $alumno->alu_apellido = $request->get('alu_apellido');
     $alumno->alu_aul_id = $request->get('alu_aul_id');
     $alumno->alu_car_id = $request->get('alu_car_id');
     $alumno->save();
     return $alumno;
 }
Exemplo n.º 2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $validator = Validator::make($request->all(), ['alu_nombre' => 'required', 'alu_apellido' => 'required']);
     if ($validator->fails()) {
         return redirect()->route('alu_create_url')->withErrors($validator)->withInput();
     }
     $alumno = new Alumno();
     $alumno->alu_nombre = $request->get('alu_nombre');
     $alumno->alu_apellido = $request->get('alu_apellido');
     $alumno->alu_aul_id = $request->get('alu_aul_id');
     $alumno->alu_car_id = $request->get('alu_car_id');
     $alumno->save();
     return redirect()->route('alu_index_url');
 }