HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1017-azure #17~24.04.1-Ubuntu SMP Mon Dec 1 20:10:50 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/ghayatcom/ghayatcom-api/database/seeders/SubscriptionSeeder.php
<?php

namespace Database\Seeders;

use App\SubscriptionPlan;
use App\SubscriptionPrice;
use Illuminate\Database\Seeder;

class SubscriptionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $datas = [
            1 => [
                'stripe_plan_id' => 'prod_Kv2gb6QOZcqdRG',
                'name' => 'Free account',
                'description' => 'Free account description',
                'created_by' => 1,
            ],
            2 => [
                'stripe_plan_id' => 'prod_Kv3Pcyu5Q10blp',
                'name' => 'Premium account',
                'description' => 'Premium account description',
                'created_by' => 1,
            ],
        ];
        foreach ($datas as $id => $data) {
            $row = SubscriptionPlan::firstOrNew([
                'id' => $id,
            ]);
            $row->fill($data);
            $row->save();
        }

        $datas = [
            1 => [
                'plan_id' => 2,
                'stripe_price_id' => 'plan_L2bXcrD9mwTTFQ',
                'amount' => 5,
                'currency_code' => 'EUR',
                'interval' => 'month',
                'status' => 'active',
                'created_by' => 1,
            ],
            2 => [
                'plan_id' => 2,
                'stripe_price_id' => 'plan_L2bcuIFwzvd39X',
                'amount' => 50,
                'currency_code' => 'EUR',
                'interval' => 'year',
                'status' => 'active',
                'created_by' => 1,
            ],
        ];
        foreach ($datas as $id => $data) {
            $row = SubscriptionPrice::firstOrNew([
                'id' => $id,
            ]);
            $row->fill($data);
            $row->save();
        }
    }
}