2024-05-15 00:31:24 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
use App\Models\Mod;
|
|
|
|
use App\Models\ModVersion;
|
|
|
|
use App\Models\SptVersion;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
use Illuminate\Support\Carbon;
|
|
|
|
|
|
|
|
class ModVersionFactory extends Factory
|
|
|
|
{
|
|
|
|
protected $model = ModVersion::class;
|
|
|
|
|
|
|
|
public function definition(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'mod_id' => Mod::factory(),
|
2024-07-03 17:47:02 -04:00
|
|
|
'version' => fake()->numerify('1.#.#'),
|
|
|
|
'description' => fake()->text(),
|
|
|
|
'link' => fake()->url(),
|
2024-05-15 00:31:24 -04:00
|
|
|
'spt_version_id' => SptVersion::factory(),
|
2024-07-03 17:47:02 -04:00
|
|
|
'virus_total_link' => fake()->url(),
|
|
|
|
'downloads' => fake()->randomNumber(),
|
2024-07-23 09:27:36 -04:00
|
|
|
'created_at' => Carbon::now()->subDays(rand(0, 365))->subHours(rand(0, 23)),
|
|
|
|
'updated_at' => Carbon::now()->subDays(rand(0, 365))->subHours(rand(0, 23)),
|
2024-05-15 00:31:24 -04:00
|
|
|
];
|
|
|
|
}
|
2024-07-31 14:51:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicate that the mod version should be disabled.
|
|
|
|
*/
|
|
|
|
public function disabled(): static
|
|
|
|
{
|
|
|
|
return $this->state(fn (array $attributes) => [
|
|
|
|
'disabled' => true,
|
|
|
|
]);
|
|
|
|
}
|
2024-05-15 00:31:24 -04:00
|
|
|
}
|