fillPropertyValues(); } private function fillPropertyValues() { DB::transaction(function () { $table = 'property_values.json'; DB::table($table)->truncate(); $items = Items::fromFile( database_path('data/property_values.json'), ['decoder' => new ExtJsonDecoder(true)] ); foreach ($items as $data) { DB::table($table)->insert([ 'id' => $data['id'], 'attribute_id' => $data['attribute_id'], 'value' => str_replace('"tm"', '"tk"', $data['name']), ]); // "string_value": "Ci4wU42HuY", } }); } }