move disabled property

This commit is contained in:
IsWaffle 2024-07-31 14:51:50 -04:00
parent a1ae15fb67
commit 5fe0541593
2 changed files with 20 additions and 4 deletions

View File

@ -30,13 +30,21 @@ class ModFactory extends Factory
'featured' => fake()->boolean(), 'featured' => fake()->boolean(),
'contains_ai_content' => fake()->boolean(), 'contains_ai_content' => fake()->boolean(),
'contains_ads' => fake()->boolean(), 'contains_ads' => fake()->boolean(),
'disabled' => fake()->boolean(),
'created_at' => now(), 'created_at' => now(),
'updated_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. * Indicate that the mod should be soft-deleted.
*/ */

View File

@ -22,10 +22,18 @@ class ModVersionFactory extends Factory
'spt_version_id' => SptVersion::factory(), 'spt_version_id' => SptVersion::factory(),
'virus_total_link' => fake()->url(), 'virus_total_link' => fake()->url(),
'downloads' => fake()->randomNumber(), 'downloads' => fake()->randomNumber(),
'disabled' => fake()->boolean(),
'created_at' => Carbon::now()->subDays(rand(0, 365))->subHours(rand(0, 23)), 'created_at' => Carbon::now()->subDays(rand(0, 365))->subHours(rand(0, 23)),
'updated_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,
]);
}
} }