*/ class PlatformAccountFactory extends Factory { protected $model = PlatformAccount::class; public function definition(): array { return [ 'platform' => PlatformEnum::LEMMY, 'instance_url' => 'https://lemmy.' . $this->faker->domainName(), 'username' => $this->faker->userName(), 'password' => 'test-password', 'settings' => [], 'is_active' => true, 'last_tested_at' => null, 'status' => 'untested', ]; } public function inactive(): static { return $this->state(fn (array $attributes) => [ 'is_active' => false, ]); } public function tested(): static { return $this->state(fn (array $attributes) => [ 'last_tested_at' => now()->subHours(2), 'status' => 'working', ]); } public function failed(): static { return $this->state(fn (array $attributes) => [ 'last_tested_at' => now()->subHours(2), 'status' => 'failed', ]); } }