Example #1
0
 public function run()
 {
     App\Fase::all()->each(function ($fase) {
         $fase->tareas()->attach(App\Tarea::find(rand(1, 50)));
         $fase->save();
     });
 }
Example #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     factory(App\Actividad::class, 50)->make()->each(function ($actividad) {
         $actividad->tarea()->associate(App\Tarea::find(rand(1, 50)));
         $actividad->save();
     });
 }
Example #3
0
 public function run()
 {
     App\Rol::all()->each(function ($rol) {
         $rol->tareas()->attach(App\Tarea::find(rand(1, 50)));
         $rol->save();
     });
 }