diff --git a/database/factories/ModFactory.php b/database/factories/ModFactory.php index 5afd783..f7699dc 100644 --- a/database/factories/ModFactory.php +++ b/database/factories/ModFactory.php @@ -30,13 +30,21 @@ class ModFactory extends Factory 'featured' => fake()->boolean(), 'contains_ai_content' => fake()->boolean(), 'contains_ads' => fake()->boolean(), - 'disabled' => fake()->boolean(), 'created_at' => now(), 'updated_at' => now(), - 'published_at' => now()->subHours(3), ]; } + /** + * Indicate that the mod should be disabled. + */ + public function disabled(): static + { + return $this->state(fn (array $attributes) => [ + 'disabled' => true, + ]); + } + /** * Indicate that the mod should be soft-deleted. */ diff --git a/database/factories/ModVersionFactory.php b/database/factories/ModVersionFactory.php index cf4c48a..a282b4f 100644 --- a/database/factories/ModVersionFactory.php +++ b/database/factories/ModVersionFactory.php @@ -22,10 +22,18 @@ class ModVersionFactory extends Factory 'spt_version_id' => SptVersion::factory(), 'virus_total_link' => fake()->url(), 'downloads' => fake()->randomNumber(), - 'disabled' => fake()->boolean(), 'created_at' => Carbon::now()->subDays(rand(0, 365))->subHours(rand(0, 23)), 'updated_at' => Carbon::now()->subDays(rand(0, 365))->subHours(rand(0, 23)), - 'published_at' => Carbon::now()->subDays(rand(0, 100))->addDays(rand(0, 365))->subHours(rand(0, 23))->addHours(rand(0, 23)), ]; } + + /** + * Indicate that the mod version should be disabled. + */ + public function disabled(): static + { + return $this->state(fn (array $attributes) => [ + 'disabled' => true, + ]); + } }