⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.31
Server IP:
95.217.99.93
Server:
Linux sv1.sonichosted.com 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
lifestylescentra
/
www
/
database
/
seeders
/
View File Name :
BasicPlanSeeder.php
<?php namespace Database\Seeders; use App\Enums\SubscriptionPlanType; use Illuminate\Database\Seeder; use Modules\Subscription\app\Models\SubscriptionPlan; class BasicPlanSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $planNames = ['Basic Plan', 'Standard Plan', 'Premium Plan']; $expirationDates = SubscriptionPlanType::getAll(); foreach (range(1, 3) as $index) { $planName = $planNames[$index - 1]; $subscription = SubscriptionPlan::create([ 'plan_name' => $planName, 'plan_price' => 100 * $index, 'expiration_date' => $expirationDates[array_rand($expirationDates)], 'status' => 1, 'serial' => $index, ]); foreach(range(1,5) as $index){ $subscription->options()->create([ 'name' => 'Option ' . $index, ]); } } } }