Skip to content

Commit

Permalink
update readme for version 3
Browse files Browse the repository at this point in the history
  • Loading branch information
PyaeSoneAungRgn committed Feb 19, 2023
1 parent e7a2371 commit 88e13f2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 12 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Pyae Sone Aung
Copyright (c) 2022 Pyae Sone Aung <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
55 changes: 44 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
A package for Myanmar tools which extend Laravel’s core.

- ⚡️ Simple & Powerful
- 🇲🇲 Include Myanmar Font, Phone Number and NRC tools
- ⚙️ Extend Str, Builder, Request, Collection and Validator
- 🇲🇲 Include Myanmar Font, Phone Number, NRC and Date tools
- ⚙️ Extend Str, Eloquent Builder, Query Builder, Request, Collection, Validator and Carbon
- 🤝 Support Laravel 10.\* | 9.\* | 8.\* | 7.\* | 6.\*

## Installation
Expand All @@ -17,13 +17,20 @@ A package for Myanmar tools which extend Laravel’s core.
composer require pyaesoneaung/laravel-myanmar-tools
```

## Version Compatibilities

| Laravel | Package |
| ------------- | ------------- |
| 9.x - 10.x | 3.x |
| 6.x - 10.x | 2.x |

## Documentation

📚 Read the full documentation at [laravel-myanmar-tools.com](https://laravel-myanmar-tools.com)

## Basic Usage

Convert Zawgyi To Unicode
Str

```php
use Illuminate\Support\Str;
Expand All @@ -33,24 +40,50 @@ Str::zgToUni('ျမန္မာျပည္');
// မြန်မာပြည်
```

Check Mpt
Eloquent Builder

```php
use Illuminate\Support\Str;
use App\Models\Customer;

Str::isMpt('09250000000');
Customer::whereMpt('phone')->first();
```

// true
Request

```php
// https://{domain}.com/{path}?phone=09250000000

$request->telecomName('phone');

// mpt
```

Normalize NRC
Collection

```php
use Illuminate\Support\Str;
$data = ['မြန်မာပြည်'];

Str::normalizeNrc('၁၂/ဥကမ(နိုင်)၁၂၃၄၅၆');
collect($data)->uniToZg()->toArray();

// 12/OUKAMA(N)123456
// ['ျမန္မာျပည္']
```

Validation

```php
$request->validate([
'phone' => ['required', 'mpt'],
]);
```

Carbon

```php
use Illuminate\Support\Carbon;

Carbon::parse('2023-07-19')->isMartyrsDay();

// true
```

And more...
Expand Down

0 comments on commit 88e13f2

Please sign in to comment.