Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Functional\Streaks\Database\Factories;
|
||||
|
||||
use Functional\Streaks\Models\Achievement;
|
||||
use Functional\Users\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Achievement>
|
||||
*/
|
||||
class AchievementFactory extends Factory
|
||||
{
|
||||
protected $model = Achievement::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => User::factory(),
|
||||
'key' => fake()->randomElement(['first_workout', 'streak_3', 'streak_7', 'streak_30', 'streak_100']),
|
||||
'earned_at' => fake()->dateTimeBetween('-90 days', 'now'),
|
||||
'meta' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user