12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
37
database/factories/UserPaymentOptionFactory.php
Normal file
37
database/factories/UserPaymentOptionFactory.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\UserPaymentOptionStatus;
|
||||
use App\Models\PaymentOption;
|
||||
use App\Models\User;
|
||||
use App\Models\UserPaymentOption;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<UserPaymentOption>
|
||||
*/
|
||||
class UserPaymentOptionFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue