/ database / factories / EvaluatorFactory.php
EvaluatorFactory.php
 1  <?php
 2  
 3  namespace Database\Factories;
 4  
 5  use App\Models\Evaluator;
 6  use App\Models\Laboratory;
 7  use Illuminate\Database\Eloquent\Factories\Factory;
 8  
 9  class EvaluatorFactory extends Factory
10  {
11      /**
12       * The name of the factory's corresponding model.
13       *
14       * @var string
15       */
16      protected $model = Evaluator::class;
17  
18      /**
19       * Define the model's default state.
20       *
21       * @return array
22       */
23      public function definition()
24      {
25          return [
26              'name' => $this->faker->name(),
27              'identification_number' => '123123',
28              'laboratory_id' => Laboratory::all()->random()->id,
29          ];
30      }
31  }