Files
neckfireandClaude Opus 4.8 af32669931
Build & Deploy / build (push) Successful in 18s
StreakFit — API Laravel 13 OSDD + Octane/FrankenPHP
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 03:00:17 +02:00

40 lines
1.0 KiB
PHP

<?php
namespace Functional\Streaks\Database\Factories;
use Functional\Streaks\Enums\GoalPeriod;
use Functional\Streaks\Enums\GoalType;
use Functional\Streaks\Models\Goal;
use Functional\Users\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Goal>
*/
class GoalFactory extends Factory
{
protected $model = Goal::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$type = fake()->randomElement(GoalType::cases());
return [
'user_id' => User::factory(),
'type' => $type,
'target' => match ($type) {
GoalType::WeeklySessions => fake()->numberBetween(2, 6),
GoalType::WeeklyMinutes => fake()->numberBetween(60, 300),
GoalType::WeeklyVolume => fake()->numberBetween(1000, 10000),
},
'period' => GoalPeriod::Week,
'is_active' => fake()->boolean(85),
];
}
}