nice 404 page
This commit is contained in:
@@ -43,7 +43,7 @@ class DatabaseSeeder extends Seeder
|
||||
// ProductCategoryRelationshipsSeeder::class,
|
||||
// ProductBarcodesSeeder::class,
|
||||
// ProductPropertiesSeeder::class,
|
||||
ProductPropertyValuesSeeder::class,
|
||||
// ProductPropertyValuesSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,21 +11,41 @@ use JsonMachine\JsonDecoder\ExtJsonDecoder;
|
||||
class ProductPropertyValuesSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$this->fillPropertyValues();
|
||||
}
|
||||
|
||||
private function fillPropertyValues()
|
||||
{
|
||||
DB::transaction(function () {
|
||||
$table = 'attribute_value_product_attribute';
|
||||
$table = 'property_values.json';
|
||||
|
||||
DB::table($table)->truncate();
|
||||
|
||||
$items = Items::fromFile(
|
||||
database_path('data/item_property_values.json'),
|
||||
database_path('data/property_values.json'),
|
||||
['decoder' => new ExtJsonDecoder(true)]
|
||||
);
|
||||
|
||||
foreach ($items as $data) {
|
||||
DB::table($table)->insert([
|
||||
'product_id' => $data['item_id'],
|
||||
'attribute_value_id' => $data['property_value_id'],
|
||||
'id' => $data['id'],
|
||||
'attribute_id' => $data['attribute_id'],
|
||||
|
||||
// "name": "{\"en\": \"8 GB\", \"ru\": \"8 GB\", \"tm\": \"8 GB\"}",
|
||||
// "description": null,
|
||||
// "string_value": "Ci4wU42HuY",
|
||||
// "text_value": null,
|
||||
// "integer_value": null,
|
||||
// "float_value": null,
|
||||
// "boolean_value": null,
|
||||
// "date_value": null,
|
||||
// "datetime_value": null,
|
||||
// "json_value": null,
|
||||
// "image_value": null,
|
||||
// "file_value": null,
|
||||
// "created_at": "2025-06-10 16:12:32",
|
||||
// "updated_at": "2025-06-10 16:12:34"
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user