'decimal:2', 'min_transaction' => 'decimal:2', 'start_date' => 'date', 'end_date' => 'date', 'quota' => 'integer', 'used_count' => 'integer', 'loyal_only' => 'boolean', ]; public function rentalCompany(): BelongsTo { return $this->belongsTo(RentalCompany::class); } public function bookings(): HasMany { return $this->hasMany(Booking::class); } public function getDiscountLabelAttribute(): string { if ($this->discount_type === self::DISCOUNT_PERCENT) { return rtrim(rtrim(number_format((float) $this->discount_value, 2, '.', ''), '0'), '.') . '%'; } return 'Rp ' . number_format((float) $this->discount_value, 0, ',', '.'); } }