Build & Deploy / build (push) Successful in 18s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
785 B
PHP
32 lines
785 B
PHP
<?php
|
|
|
|
namespace Functional\Streaks\Database\Factories;
|
|
|
|
use Functional\Streaks\Enums\StreakDaySource;
|
|
use Functional\Streaks\Models\StreakDay;
|
|
use Functional\Users\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<StreakDay>
|
|
*/
|
|
class StreakDayFactory extends Factory
|
|
{
|
|
protected $model = StreakDay::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'date' => fake()->unique()->dateTimeBetween('-60 days', 'now')->format('Y-m-d'),
|
|
'source' => fake()->randomElement(StreakDaySource::cases()),
|
|
'workout_session_id' => null,
|
|
];
|
|
}
|
|
}
|