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