*/ class UserPaymentOptionFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'user_id' => User::factory(), 'payment_option_id' => PaymentOption::factory(), 'status' => fake()->randomElement(UserPaymentOptionStatus::cases())->value, 'grandfathered_until' => fake()->optional()->dateTimeBetween('now', '+2 years'), 'legacy_conditions' => fake()->boolean(25) ? ['note' => fake()->sentence(), 'discount_percent' => fake()->numberBetween(5, 40)] : null, 'current_period_start' => now()->startOfMonth(), 'current_period_end' => now()->endOfMonth(), 'stripe_subscription_id' => fake()->optional()->regexify('sub_[A-Za-z0-9]{14}'), 'cancelled_at' => null, ]; } }