translatable = ['name','description']; } } public function values() { return $this->hasMany(AttributeValue::class); } public function colors(){ return $this->hasManyThrough(Color::class,AttributeValue::class,'attribute_id','attribute_value_id','id','id'); } public static function boot() { parent::boot(); static::created(function ($attribute) { $attribute->created_by = Auth::user()->id ?? null; }); static::updating(function ($attribute) { $attribute->updated_by = Auth::user()->id ?? null; }); } public function scopeActive($query) { return $query->where('status', 1); } }