belongsTo(AttributeFamily::class); } /** * The categories that belong to the product. */ public function categories() { return $this->belongsToMany(Category::class, 'product_categories'); } /** * The inventories that belong to the product. */ public function inventories() { return $this->belongsToMany(InventorySource::class, 'product_inventories'); } /** * The super attributes that belong to the product. */ public function super_attributes() { return $this->belongsToMany(Attribute::class, 'product_super_attributes'); } /** * The related products that belong to the product. */ public function related_products() { return $this->belongsToMany(self::class, 'product_relations'); } /** * The up sells that belong to the product. */ public function up_sells() { return $this->belongsToMany(self::class, 'product_up_sells'); } /** * The cross sells that belong to the product. */ public function cross_sells() { return $this->belongsToMany(self::class, 'product_cross_sells'); } public function __get($name) { // if(array_key_exists($name, $this->data)) { // return $this->data[$name]; // } return null; } }