⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
stores.dev-unit.com
/
database
/
seeders
/
View File Name :
ProductOptionSeeder.php
<?php namespace Database\Seeders; use Botble\Ecommerce\Database\Seeders\ProductOptionSeeder as BaseProductOptionSeeder; use Botble\Ecommerce\Option\OptionType\Dropdown; use Botble\Ecommerce\Option\OptionType\RadioButton; class ProductOptionSeeder extends BaseProductOptionSeeder { public function run(): void { $options = [ [ 'name' => 'Warranty', 'option_type' => RadioButton::class, 'required' => true, 'values' => [ [ 'option_value' => '1 Year', 'affect_price' => 0, 'affect_type' => 0, ], [ 'option_value' => '2 Year', 'affect_price' => 10, 'affect_type' => 0, ], [ 'option_value' => '3 Year', 'affect_price' => 20, 'affect_type' => 0, ], ], ], [ 'name' => 'RAM', 'option_type' => RadioButton::class, 'required' => true, 'values' => [ [ 'option_value' => '4GB', 'affect_price' => 0, 'affect_type' => 0, ], [ 'option_value' => '8GB', 'affect_price' => 10, 'affect_type' => 0, ], [ 'option_value' => '16GB', 'affect_price' => 20, 'affect_type' => 0, ], ], ], [ 'name' => 'CPU', 'option_type' => RadioButton::class, 'required' => true, 'values' => [ [ 'option_value' => 'Core i5', 'affect_price' => 0, 'affect_type' => 0, ], [ 'option_value' => 'Core i7', 'affect_price' => 10, 'affect_type' => 0, ], [ 'option_value' => 'Core i9', 'affect_price' => 20, 'affect_type' => 0, ], ], ], [ 'name' => 'HDD', 'option_type' => Dropdown::class, 'required' => false, 'values' => [ [ 'option_value' => '128GB', 'affect_price' => 0, 'affect_type' => 0, ], [ 'option_value' => '256GB', 'affect_price' => 10, 'affect_type' => 0, ], [ 'option_value' => '512GB', 'affect_price' => 20, 'affect_type' => 0, ], ], ], ]; $this->saveGlobalOption($options); } }