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/PaymentOptionFactory.php
Normal file
37
database/factories/PaymentOptionFactory.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\PaymentOptionType;
|
||||
use App\Models\PaymentOption;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<PaymentOption>
|
||||
*/
|
||||
class PaymentOptionFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$type = fake()->randomElement(PaymentOptionType::cases())->value;
|
||||
$interval = $type === PaymentOptionType::Onetime->value
|
||||
? 'once'
|
||||
: fake()->randomElement(['monthly', 'yearly']);
|
||||
|
||||
return [
|
||||
'article_number' => 'ART-'.fake()->unique()->numerify('#####'),
|
||||
'type' => $type,
|
||||
'price_cents' => fake()->numberBetween(990, 49900),
|
||||
'currency' => 'EUR',
|
||||
'interval' => $interval,
|
||||
'is_hidden' => false,
|
||||
'stripe_product_id' => 'prod_'.fake()->regexify('[A-Za-z0-9]{14}'),
|
||||
'stripe_price_id' => 'price_'.fake()->regexify('[A-Za-z0-9]{14}'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue