'integer', 'type' => PriceType::class, ]; } public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logUnguarded() ->logOnlyDirty() ->dontLogEmptyChanges() ->logExcept([ 'id', 'variant_id', 'deleted_at', ]); } // 3. Attribute public function priceFormatted(): Attribute { return Attribute::make( get: fn() => 'Rp ' . number_format($this->price, 0, ',', '.'), ); } public function priceInput(): Attribute { return Attribute::make( get: fn() => (string) $this->price, ); } // 4. Relation public function variant(): BelongsTo { return $this->belongsTo(ProductVariant::class, 'variant_id')->withTrashed(); } }