forge/database/factories/SptVersionFactory.php
Refringe db578071e4
SPT Semvar & Automatic Resolution
This update gives mod versions a supported SPT version field that accepts a semantic version. The latest supported SPT version will be automatically resolved based on the semvar.

Next up: I need to update the ModVersion to SptVersion relationship to be a many-to-many and expand the resolution to resolve multiple versions.
2024-08-22 17:04:07 -04:00

24 lines
614 B
PHP

<?php
namespace Database\Factories;
use App\Models\SptVersion;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class SptVersionFactory extends Factory
{
protected $model = SptVersion::class;
public function definition(): array
{
return [
'version' => $this->faker->numerify('#.#.#'),
'color_class' => $this->faker->randomElement(['red', 'green', 'emerald', 'lime', 'yellow', 'grey']),
'link' => $this->faker->url,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];
}
}