change phone number display

This commit is contained in:
2026-04-26 15:24:05 -04:00
parent ad66fef19b
commit d64e1d5578
13 changed files with 57 additions and 14 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
namespace App\Helpers;
class PhoneHelper
{
public static function format($phone)
{
$phone = preg_replace('/[^0-9]/', '', $phone);
if (strlen($phone) == 10) {
return preg_replace('/([0-9]{3})([0-9]{3})([0-9]{4})/', '$1-$2-$3', $phone);
}
return $phone;
}
}