12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
78
database/seeders/PaymentOptionSeeder.php
Normal file
78
database/seeders/PaymentOptionSeeder.php
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Enums\PaymentOptionType;
|
||||
use App\Models\PaymentOption;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PaymentOptionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$options = [
|
||||
[
|
||||
'article_number' => 'PR-MONTHLY-001',
|
||||
'type' => PaymentOptionType::Recurring->value,
|
||||
'price_cents' => 4900,
|
||||
'currency' => 'EUR',
|
||||
'interval' => 'monthly',
|
||||
'is_hidden' => false,
|
||||
'stripe_product_id' => 'prod_placeholder_monthly',
|
||||
'stripe_price_id' => 'price_placeholder_monthly',
|
||||
'translations' => [
|
||||
'de' => ['name' => 'Monatspaket', 'description' => 'Monatliche Veroeffentlichungen'],
|
||||
'en' => ['name' => 'Monthly package', 'description' => 'Monthly publication package'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'article_number' => 'PR-YEARLY-001',
|
||||
'type' => PaymentOptionType::Recurring->value,
|
||||
'price_cents' => 49900,
|
||||
'currency' => 'EUR',
|
||||
'interval' => 'yearly',
|
||||
'is_hidden' => false,
|
||||
'stripe_product_id' => 'prod_placeholder_yearly',
|
||||
'stripe_price_id' => 'price_placeholder_yearly',
|
||||
'translations' => [
|
||||
'de' => ['name' => 'Jahrespaket', 'description' => 'Jaehrliche Veroeffentlichungen'],
|
||||
'en' => ['name' => 'Yearly package', 'description' => 'Yearly publication package'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'article_number' => 'PR-BOOST-ONCE-001',
|
||||
'type' => PaymentOptionType::Onetime->value,
|
||||
'price_cents' => 9900,
|
||||
'currency' => 'EUR',
|
||||
'interval' => 'once',
|
||||
'is_hidden' => false,
|
||||
'stripe_product_id' => 'prod_placeholder_onetime',
|
||||
'stripe_price_id' => 'price_placeholder_onetime',
|
||||
'translations' => [
|
||||
'de' => ['name' => 'Reichweiten-Boost', 'description' => 'Einmaliger Promotion-Boost'],
|
||||
'en' => ['name' => 'Reach boost', 'description' => 'One-time promotion boost'],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($options as $optionData) {
|
||||
$translations = $optionData['translations'];
|
||||
unset($optionData['translations']);
|
||||
|
||||
$option = PaymentOption::updateOrCreate(
|
||||
['article_number' => $optionData['article_number']],
|
||||
$optionData
|
||||
);
|
||||
|
||||
foreach ($translations as $locale => $translation) {
|
||||
$option->translations()->updateOrCreate(
|
||||
['locale' => $locale],
|
||||
$translation
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue