|
1 |
| -# :package_name |
2 |
| - |
3 |
| -[![Latest Version on Packagist][ico-version]][link-packagist] |
4 |
| -[![Software License][ico-license]](LICENSE.md) |
5 |
| -[![Build Status][ico-travis]][link-travis] |
6 |
| -[![Coverage Status][ico-scrutinizer]][link-scrutinizer] |
7 |
| -[![Quality Score][ico-code-quality]][link-code-quality] |
8 |
| -[![Total Downloads][ico-downloads]][link-downloads] |
9 |
| - |
10 |
| -**Note:** Replace ```:author_name``` ```:author_username``` ```:author_website``` ```:author_email``` ```:vendor``` ```:package_name``` ```:package_description``` with their correct values in [README.md](README.md), [CHANGELOG.md](CHANGELOG.md), [CONTRIBUTING.md](CONTRIBUTING.md), [LICENSE.md](LICENSE.md) and [composer.json](composer.json) files, then delete this line. You can run `$ php prefill.php` in the command line to make all replacements at once. Delete the file prefill.php as well. |
11 |
| - |
12 |
| -This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what |
13 |
| -PSRs you support to avoid any confusion with users and contributors. |
14 |
| - |
15 |
| -## Structure |
16 |
| - |
17 |
| -If any of the following are applicable to your project, then the directory structure should follow industry best practises by being named the following. |
18 |
| - |
19 |
| -``` |
20 |
| -bin/ |
21 |
| -config/ |
22 |
| -src/ |
23 |
| -tests/ |
24 |
| -vendor/ |
25 |
| -``` |
| 1 | +# Persianalize |
26 | 2 |
|
| 3 | +**Persianalize** use to normalize Persian input and remove arabic and other similar characters. |
27 | 4 |
|
28 | 5 | ## Install
|
29 | 6 |
|
30 | 7 | Via Composer
|
31 | 8 |
|
32 | 9 | ``` bash
|
33 |
| -$ composer require :vendor/:package_name |
| 10 | +$ composer require mahdimajidzadeh/persianalize |
34 | 11 | ```
|
35 | 12 |
|
36 |
| -## Usage |
| 13 | +If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php: |
37 | 14 |
|
38 | 15 | ``` php
|
39 |
| -$skeleton = new League\Skeleton(); |
40 |
| -echo $skeleton->echoPhrase('Hello, League!'); |
| 16 | +MahdiMajidzadeh\Persianalize\PersianalizeServiceProvider:class |
41 | 17 | ```
|
42 | 18 |
|
43 |
| -## Change log |
44 |
| - |
45 |
| -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. |
| 19 | +If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider. |
46 | 20 |
|
47 |
| -## Testing |
48 |
| - |
49 |
| -``` bash |
50 |
| -$ composer test |
51 |
| -``` |
52 |
| - |
53 |
| -## Contributing |
54 |
| - |
55 |
| -Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details. |
56 |
| - |
57 |
| -## Security |
| 21 | +## Usage |
58 | 22 |
|
59 |
| -If you discover any security related issues, please email :author_email instead of using the issue tracker. |
| 23 | +``` php |
| 24 | +$result = Persian::numbers_fa('123٤٥٦'); // return ۱۲۳۴۵۶ |
60 | 25 |
|
61 |
| -## Credits |
| 26 | +$result = Persian::numbers_en('۱۲۳٤٥٦'); // return 123456 |
62 | 27 |
|
63 |
| -- [:author_name][link-author] |
64 |
| -- [All Contributors][link-contributors] |
| 28 | +$result = Persian::text('ي ڲ ڬ'); // return ی گ ک |
65 | 29 |
|
66 |
| -## License |
| 30 | +$result = Persian::persian($text); // make texts and numbers Persian |
67 | 31 |
|
68 |
| -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
| 32 | +$result = Persian::standard($text); // make texts Persian and numbers English |
| 33 | +``` |
69 | 34 |
|
70 |
| -[ico-version]: https://img.shields.io/packagist/v/:vendor/:package_name.svg?style=flat-square |
71 |
| -[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square |
72 |
| -[ico-travis]: https://img.shields.io/travis/:vendor/:package_name/master.svg?style=flat-square |
73 |
| -[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/:vendor/:package_name.svg?style=flat-square |
74 |
| -[ico-code-quality]: https://img.shields.io/scrutinizer/g/:vendor/:package_name.svg?style=flat-square |
75 |
| -[ico-downloads]: https://img.shields.io/packagist/dt/:vendor/:package_name.svg?style=flat-square |
| 35 | +## Change log |
76 | 36 |
|
77 |
| -[link-packagist]: https://packagist.org/packages/:vendor/:package_name |
78 |
| -[link-travis]: https://travis-ci.org/:vendor/:package_name |
79 |
| -[link-scrutinizer]: https://scrutinizer-ci.com/g/:vendor/:package_name/code-structure |
80 |
| -[link-code-quality]: https://scrutinizer-ci.com/g/:vendor/:package_name |
81 |
| -[link-downloads]: https://packagist.org/packages/:vendor/:package_name |
82 |
| -[link-author]: https://github.com/:author_username |
83 |
| -[link-contributors]: ../../contributors |
| 37 | +Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. |
0 commit comments