You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/database/seeders/PropSeeder.php

97 lines
3.3 KiB
PHTML

7 months ago
<?php
namespace Database\Seeders;
use App\Models\Category;
use App\Models\Prop;
7 months ago
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class PropSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
Prop::factory()->create([
4 months ago
'label' => __('Color'),
'name'=>'color',
'type'=>'color',
'options' => '[{"title":"black","value":"#000000"},{"title":"white","value":"#ffffff"},{"title":"rose gold","value":"#be9289"},{"title":"silver","value":"#c0c0c0"},{"title":"gold","value":"#d4af37"}]',
'searchable'=> 0,
4 months ago
'priceable' => 1,
'icon' => 'ri-palette-line',
]);
Prop::factory()->create([
4 months ago
'label' => __('Warranty'),
'name'=>'warranty',
'type'=>'select',
'options' => '[{"title":"no warranty","value":"-1"},{"title":"Rayan","value":"1"},{"title":"Arian","value":"3"},{"title":"Avajang","value":"4"},{"title":"Sazgar Aragham","value":"5"}]',
'searchable'=> 0,
4 months ago
'priceable' => 1,
'icon' => 'ri-shield-check-line',
]);
Prop::factory()->create([
4 months ago
'label' => __('Network'),
'name'=>'net',
'type'=>'multi',
'options' => '[{"title":"2G","value":"2g"},{"title":"3G","value":"3g"},{"title":"4G","value":"4g"},{"title":"5G","value":"5g"}]',
'searchable'=> 1,
4 months ago
'priceable' => 0,
'icon' => 'ri-signal-tower-line',
]);
Prop::factory()->create([
4 months ago
'label' => __('Internal storage'),
'name'=>'hdd',
'type'=>'select',
'options' => '[{"title":"16 Gig","value":"16"},{"title":"32 Gig","value":"32"},{"title":"64 gig","value":"64"},{"title":"128 Gig","value":"128"},{"title":"256 G","value":"256"}]',
'searchable'=> 1,
4 months ago
'priceable' => 1,
'icon' => 'ri-hard-drive-3-line',
]);
Prop::factory()->create([
4 months ago
'label' => __('Front camera'),
'name'=>'fcamera',
'type'=>'text',
'options' => '[]',
'searchable'=> 0,
4 months ago
'priceable' => 0,
'icon' => 'ri-camera-3-line',
]);
Prop::factory()->create([
4 months ago
'label' => __('Display technology'),
'name'=>'lcd',
'type'=>'text',
'options' =>'[]',
'searchable'=> 0,
4 months ago
'priceable' => 0,
'icon' => 'ri-smartphone-line',
]);
Prop::factory()->create([
4 months ago
'label' => __('Sim card count'),
'name'=>'sim',
'type'=>'number',
'options' =>'[]',
'searchable'=> 1,
4 months ago
'priceable' => 0,
'icon' => 'ri-sim-card-2-line',
]);
Prop::factory()->create([
4 months ago
'label' => __('Support SD card'),
'name'=>'sdcard',
'type'=>'checkbox',
'options' =>'[]',
'searchable'=> 1,
4 months ago
'priceable' => 0,
'icon' => 'ri-sd-card-line',
]);
Category::where('id',1)->first()->props()->sync(Prop::pluck('id')->toArray());
Category::where('id',2)->first()->props()->sync(Prop::pluck('id')->toArray());
7 months ago
}
}