コード例 #1
0
ファイル: TitulosTableSeeder.php プロジェクト: JCarlosR/SIL
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Titulo::create(['rit_id' => 1, 'nombre' => 'TÍTULO PRIMERO']);
     Titulo::create(['rit_id' => 1, 'nombre' => 'TÍTULO SEGUNDO']);
     Titulo::create(['rit_id' => 1, 'nombre' => 'TÍTULO TERCERO']);
     Titulo::create(['rit_id' => 1, 'nombre' => 'TÍTULO CUARTO']);
     Titulo::create(['rit_id' => 1, 'nombre' => 'TÍTULO QUINTO']);
     Titulo::create(['rit_id' => 1, 'nombre' => 'TÍTULO SEXTO']);
 }
コード例 #2
0
ファイル: RitController.php プロジェクト: JCarlosR/SIL
 public function postTitulo(Request $request)
 {
     $this->validate($request, ['nombre' => 'required|min:2']);
     // Luego hacer más complejo con ctrl de versiones para el perfil de trab
     $titulo = Titulo::create(['rit_id' => 1, 'nombre' => $request->get('nombre')]);
     return response()->json($titulo);
 }