Exemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $id = Resume::first()->id;
     factory(Language::class)->create(['resume_id' => $id, 'name' => 'English', 'proficiency' => 'Fluent']);
     factory(Language::class)->create(['resume_id' => $id, 'name' => 'Portuguese', 'proficiency' => 'Fluent']);
     factory(Language::class)->create(['resume_id' => $id, 'name' => 'Spanish', 'proficiency' => 'Basic']);
 }
Exemplo n.º 2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $skills = Skill::lists('id');
     $last = count($skills) - 1;
     $resume = Resume::first();
     for ($i = 0; $i < 1; $i++) {
         $certificate = $resume->certificates()->create(['title' => 'PHP Master', 'length' => '300 hours', 'certified_by' => 'My Friend']);
         if (count($skills)) {
             $certificate->skills()->attach($skills[rand(0, $last)]);
         }
     }
 }