sarga/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php

446 lines
13 KiB
PHP
Raw Normal View History

2018-07-27 06:22:12 +00:00
<?php
namespace Webkul\Attribute\Database\Seeders;
use Illuminate\Database\Seeder;
use Webkul\Attribute\Repositories\AttributeRepository;
class AttributeTableSeeder extends Seeder
{
/**
* @var array
*/
protected $rawData = [
[
2018-07-27 09:30:48 +00:00
'code' => 'sku',
'admin_name' => 'SKU',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'SKU'
],
2018-07-27 09:30:48 +00:00
'type' => 'text',
'position' => 1,
'is_unique' => 1,
'is_required' => 1,
'value_per_locale' => 0,
'value_per_channel' => 0,
2018-08-17 05:48:21 +00:00
'is_filterable' => 0,
2018-07-27 09:30:48 +00:00
'is_configurable' => 0,
'is_user_defined' => 0
], [
2018-07-27 06:22:12 +00:00
'code' => 'name',
'admin_name' => 'Name',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Name'
],
2018-07-27 06:22:12 +00:00
'type' => 'text',
2018-07-27 09:30:48 +00:00
'position' => 2,
2018-07-27 06:22:12 +00:00
'is_required' => 1,
'value_per_locale' => 1,
'value_per_channel' => 1,
2018-08-17 05:48:21 +00:00
'is_filterable' => 0,
2018-07-27 06:22:12 +00:00
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'url_key',
'admin_name' => 'URL Key',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'URL Key'
],
2018-07-27 06:22:12 +00:00
'type' => 'text',
2018-07-27 09:30:48 +00:00
'position' => 3,
2018-07-27 06:22:12 +00:00
'is_unique' => 1,
'is_required' => 1,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
2018-10-12 08:22:06 +00:00
], [
'code' => 'tax_category_id',
'admin_name' => 'Tax Category',
'en' => [
'name' => 'Tax Category'
],
2018-10-15 10:39:09 +00:00
'type' => 'select',
2018-10-12 08:22:06 +00:00
'position' => 4,
'is_unique' => 0,
'is_required' => 0,
'value_per_locale' => 0,
'value_per_channel' => 1,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
2018-07-27 06:22:12 +00:00
], [
2018-10-10 10:26:27 +00:00
'code' => 'new',
'admin_name' => 'New',
'en' => [
'name' => 'New'
],
'type' => 'boolean',
2018-10-12 08:22:06 +00:00
'position' => 5,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
2018-10-10 10:26:27 +00:00
'code' => 'featured',
'admin_name' => 'Featured',
'en' => [
'name' => 'Featured'
],
'type' => 'boolean',
2018-10-12 08:22:06 +00:00
'position' => 6,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
2018-08-09 04:35:13 +00:00
], [
'code' => 'visible_individually',
'admin_name' => 'Visible Individually',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Visible Individually'
],
2018-08-09 04:35:13 +00:00
'type' => 'boolean',
2018-10-12 08:22:06 +00:00
'position' => 7,
2018-08-09 04:35:13 +00:00
'is_required' => 1,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
2018-07-27 06:22:12 +00:00
], [
'code' => 'status',
'admin_name' => 'Status',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Status'
],
2018-07-27 06:22:12 +00:00
'type' => 'boolean',
2018-10-12 08:22:06 +00:00
'position' => 8,
2018-07-27 06:22:12 +00:00
'is_required' => 1,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'short_description',
'admin_name' => 'Short Description',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Short Description'
],
2018-07-27 06:22:12 +00:00
'type' => 'textarea',
2018-10-12 08:22:06 +00:00
'position' => 9,
2018-07-27 06:22:12 +00:00
'is_required' => 1,
'value_per_locale' => 1,
'value_per_channel' => 1,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'description',
'admin_name' => 'Description',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Description'
],
2018-07-27 06:22:12 +00:00
'type' => 'textarea',
2018-10-12 08:22:06 +00:00
'position' => 10,
2018-07-27 06:22:12 +00:00
'is_required' => 1,
'value_per_locale' => 1,
'value_per_channel' => 1,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'price',
'admin_name' => 'Price',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Price'
],
2018-07-27 06:22:12 +00:00
'type' => 'price',
2018-10-12 08:22:06 +00:00
'position' => 11,
2018-07-27 06:22:12 +00:00
'is_required' => 1,
'value_per_locale' => 0,
2018-10-17 07:21:47 +00:00
'value_per_channel' => 0,
2018-07-27 06:22:12 +00:00
'is_filterable' => 1,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'cost',
'admin_name' => 'Cost',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Cost'
],
2018-07-27 06:22:12 +00:00
'type' => 'price',
2018-10-12 08:22:06 +00:00
'position' => 12,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
2018-08-09 04:35:13 +00:00
'value_per_channel' => 1,
2018-07-27 06:22:12 +00:00
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 1
], [
'code' => 'special_price',
'admin_name' => 'Special Price',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Special Price'
],
2018-07-27 06:22:12 +00:00
'type' => 'price',
2018-10-12 08:22:06 +00:00
'position' => 13,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
2018-10-17 07:21:47 +00:00
'value_per_channel' => 0,
2018-07-27 06:22:12 +00:00
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'special_price_from',
'admin_name' => 'Special Price From',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Special Price From'
],
2018-08-21 10:58:55 +00:00
'type' => 'date',
2018-10-12 08:22:06 +00:00
'position' => 14,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
2018-08-09 04:35:13 +00:00
'value_per_channel' => 1,
2018-07-27 06:22:12 +00:00
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'special_price_to',
'admin_name' => 'Special Price To',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Special Price To'
],
2018-08-21 10:58:55 +00:00
'type' => 'date',
2018-10-12 08:22:06 +00:00
'position' => 15,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
2018-08-09 04:35:13 +00:00
'value_per_channel' => 1,
2018-07-27 06:22:12 +00:00
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'meta_title',
'admin_name' => 'Meta Title',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Meta Description'
],
2018-07-27 06:22:12 +00:00
'type' => 'textarea',
2018-10-12 08:22:06 +00:00
'position' => 16,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 1,
'value_per_channel' => 1,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'meta_keywords',
'admin_name' => 'Meta Keywords',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Meta Keywords'
],
2018-07-27 06:22:12 +00:00
'type' => 'textarea',
2018-10-12 08:22:06 +00:00
'position' => 17,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 1,
'value_per_channel' => 1,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'meta_description',
'admin_name' => 'Meta Description',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Meta Description'
],
2018-07-27 06:22:12 +00:00
'type' => 'textarea',
2018-10-12 08:22:06 +00:00
'position' => 18,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 1,
'value_per_channel' => 1,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 1
], [
'code' => 'width',
'admin_name' => 'Width',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Width'
],
2018-07-27 06:22:12 +00:00
'type' => 'text',
2018-08-17 05:48:21 +00:00
'validation' => 'numeric',
2018-10-12 08:22:06 +00:00
'position' => 19,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 1
], [
'code' => 'height',
'admin_name' => 'Height',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Height'
],
2018-07-27 06:22:12 +00:00
'type' => 'text',
2018-08-17 05:48:21 +00:00
'validation' => 'numeric',
2018-10-12 08:22:06 +00:00
'position' => 20,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 1
], [
'code' => 'depth',
'admin_name' => 'Depth',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Depth'
],
2018-07-27 06:22:12 +00:00
'type' => 'text',
2018-08-17 05:48:21 +00:00
'validation' => 'numeric',
2018-10-12 08:22:06 +00:00
'position' => 21,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 1
], [
'code' => 'weight',
'admin_name' => 'Weight',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Weight'
],
2018-07-27 06:22:12 +00:00
'type' => 'text',
2018-08-17 05:48:21 +00:00
'validation' => 'numeric',
2018-10-12 08:22:06 +00:00
'position' => 22,
2018-07-27 06:22:12 +00:00
'is_required' => 1,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 0,
'is_configurable' => 0,
'is_user_defined' => 0
], [
'code' => 'color',
'admin_name' => 'Color',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Color'
],
2018-07-27 06:22:12 +00:00
'type' => 'select',
2018-10-12 08:22:06 +00:00
'position' => 23,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 1,
'is_configurable' => 1,
'is_user_defined' => 1,
'options' => [
[
2018-10-12 08:22:06 +00:00
'admin_name' => 'Red',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'Red'
],
'sort_order' => 1
], [
2018-10-12 08:22:06 +00:00
'admin_name' => 'Green',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'Green'
],
'sort_order' => 2
], [
2018-10-12 08:22:06 +00:00
'admin_name' => 'Yellow',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'Yellow'
],
'sort_order' => 3
], [
2018-10-12 08:22:06 +00:00
'admin_name' => 'Black',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'Black'
],
'sort_order' => 4
], [
2018-10-12 08:22:06 +00:00
'admin_name' => 'White',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'White'
],
'sort_order' => 5
]
]
], [
'code' => 'size',
'admin_name' => 'Size',
2018-10-10 10:26:27 +00:00
'en' => [
'name' => 'Size'
],
2018-07-27 06:22:12 +00:00
'type' => 'select',
2018-10-12 08:22:06 +00:00
'position' => 24,
2018-07-27 06:22:12 +00:00
'is_required' => 0,
'value_per_locale' => 0,
'value_per_channel' => 0,
'is_filterable' => 1,
'is_configurable' => 1,
'is_user_defined' => 1,
'options' => [
[
2018-10-12 08:22:06 +00:00
'admin_name' => 'S',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'S'
],
'sort_order' => 1
], [
2018-10-12 08:22:06 +00:00
'admin_name' => 'M',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'M'
],
'sort_order' => 2
], [
2018-10-12 08:22:06 +00:00
'admin_name' => 'L',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'L'
],
'sort_order' => 3
], [
2018-10-12 08:22:06 +00:00
'admin_name' => 'XL',
2018-07-27 06:22:12 +00:00
'en' => [
'label' => 'XL'
],
'sort_order' => 4
]
]
]
];
/**
* AttributeRepository object
*
* @var array
*/
protected $attribute;
/**
* Create a new controller instance.
*
* @param Webkul\Attribute\Repositories\AttributeRepository $attribute
* @return void
*/
public function __construct(AttributeRepository $attribute)
{
$this->attribute = $attribute;
}
public function run()
{
2018-10-12 08:22:06 +00:00
\Illuminate\Database\Eloquent\Model::reguard();
2018-07-27 06:22:12 +00:00
foreach($this->rawData as $row) {
$this->attribute->create($row);
}
}
}