'date', 'date_expiration' => 'date', 'cle_licence' => 'encrypted', // Encrypted storage for license keys ]; public function contrat(): BelongsTo { return $this->belongsTo(Contrat::class); } public function fournisseur(): BelongsTo { return $this->belongsTo(Fournisseur::class); } public function commune(): BelongsTo { return $this->belongsTo(Commune::class); } /** * Get the usage rate as a percentage. */ public function getTauxUtilisationAttribute(): float { if ($this->nombre_sieges_total <= 0) { return 0; } return round(($this->nombre_sieges_utilises / $this->nombre_sieges_total) * 100, 2); } }