Initial commit
This commit is contained in:
41
database/factories/RoundFactory.php
Normal file
41
database/factories/RoundFactory.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Contest;
|
||||
use App\Models\EvaluationRuleSet;
|
||||
use App\Models\Round;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Round>
|
||||
*/
|
||||
class RoundFactory extends Factory
|
||||
{
|
||||
protected $model = Round::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$title = $this->faker->words(3, true);
|
||||
$start = now()->startOfDay()->addHours(14);
|
||||
$end = (clone $start)->addHours(2);
|
||||
$deadline = (clone $end)->addDays(2);
|
||||
|
||||
return [
|
||||
'contest_id' => Contest::factory(),
|
||||
'rule_set_id' => EvaluationRuleSet::factory(),
|
||||
'name' => [
|
||||
'cs' => $title,
|
||||
'en' => $title,
|
||||
],
|
||||
'description' => [
|
||||
'cs' => $this->faker->sentence(),
|
||||
'en' => $this->faker->sentence(),
|
||||
],
|
||||
'start_time' => $start,
|
||||
'end_time' => $end,
|
||||
'logs_deadline' => $deadline,
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user