Esempio n. 1
0
 public function up()
 {
     $rubro = new Rubro();
     $rubro->nombre = 'Deporte';
     $rubro->save();
     $rubro = new Rubro();
     $rubro->nombre = 'Arte';
     $rubro->save();
 }
Esempio n. 2
-2
 public function post_nuevo()
 {
     $inputs = Input::all();
     $reglas = array('nombre' => 'required|min:4');
     $mensajes = array('required' => 'Campo Obligatorio');
     $validar = Validator::make($inputs, $reglas);
     if ($validar->fails()) {
         Input::flash();
         return Redirect::back()->withInput()->withErrors($validar);
     } else {
         $rubro = new Rubro();
         $rubro->rubro = Input::get('nombre');
         $rubro->save();
         return Redirect::to('lista_rubros')->with('error', 'El Rubrop ha sido registrado con Éxito')->withInput();
     }
 }