*/ 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' => fake()->unique()->word(), 'type' => \collect(CampaignTypes::cases())->random(), 'status' => fake()->boolean(75), 'brand_id' => fake()->randomElement(Brand::pluck('id')), ]; } }