fix: Update matricule format

This commit is contained in:
Vincent BRIDIER 2024-11-26 13:02:16 +01:00
parent c332696024
commit 8ee5a940c4
No known key found for this signature in database
GPG key ID: 8571BFA20420D512

View file

@ -119,7 +119,7 @@ class Salarie extends Model
*/
public static function getFormattedMatricule(string $matricule): string
{
return ltrim(preg_replace('/[^\d]/', '', $matricule), '0');
return str_pad(ltrim(preg_replace('/[^\d]/', '', $matricule), '0'), 7, "0", STR_PAD_LEFT);
}
// * RELATIONSHIPS