Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Propaganistas authored Dec 6, 2024
1 parent bf14a40 commit f134f2a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Adds phone number functionality to Laravel based on the [PHP port](https://githu
- [Formatting](#formatting)
- [Number information](#number-information)
- [Equality comparison](#equality-comparison)
- [Helper function](#helper-function)
- [Database considerations](#database-considerations)

## Demo
Expand Down Expand Up @@ -177,6 +176,14 @@ use Propaganistas\LaravelPhone\PhoneNumber;
(string) new PhoneNumber('012 34 56 78', 'BE'); // +3212345678
```

Alternatively you can use the `phone()` helper function. It returns a `Propaganistas\LaravelPhone\PhoneNumber` instance or the formatted string if `$format` was provided:

```php
phone('+3212/34.56.78'); // PhoneNumber instance
phone('012 34 56 78', 'BE'); // PhoneNumber instance
phone('012 34 56 78', 'BE', 'e164'); // +3212345678
```

### Formatting
A PhoneNumber can be formatted in various ways:

Expand Down Expand Up @@ -227,14 +234,6 @@ $phone->notEquals('+32 45 67 89 10') // true
$phone->notEquals( $anotherPhoneObject ) // true/false
```

### Helper function

The package exposes the `phone()` helper function that returns a `Propaganistas\LaravelPhone\PhoneNumber` instance or the formatted string if `$format` was provided:

```php
phone($number, $country = [], $format = null)
```

## Database considerations

> Disclaimer: Phone number handling is quite different in each application. The topics mentioned below are therefore meant as a set of thought starters; support will **not** be provided.
Expand Down

0 comments on commit f134f2a

Please sign in to comment.