*/ class CampaignFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Campaign::class; /** * Define the model's default state. * * @return array */ public function definition() { return [ 'name' => $this->faker->unique()->word(), 'type' => \collect(CampaignTypes::cases())->random(), 'status' => $this->faker->boolean(75), 'brand_id' => $this->faker->randomElement(Brand::pluck('id')), ]; } }