Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user