Download the PHP package etchfoda/laravel-arabic-numbers-middleware without Composer
On this page you can find all versions of the php package etchfoda/laravel-arabic-numbers-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download etchfoda/laravel-arabic-numbers-middleware
More information about etchfoda/laravel-arabic-numbers-middleware
Files in etchfoda/laravel-arabic-numbers-middleware
Package laravel-arabic-numbers-middleware
Short Description auto transforms arabic/eastern to eastern/arabic numbers for i.e ١٢٣٤٥٦٧٨ to 12345678
License MIT
Homepage https://github.com/etchfoda/laravel-arabic-numbers-middleware
Informations about the package laravel-arabic-numbers-middleware
Transform between (Arabic-english)/(eastern-Indian) numbers middleware for laravel
A tiny package to transforms arabic/eastern* to eastern*/arabic numbers for i.e
١٢٣٤٥٦٧٨
to12345678
before validations to avoid invalid integers error when passeastern
numbers by (ios/mac) users
- These numbers are known as أرقام هندية ("Indian numbers") in Arabic. They are sometimes also called "Indic numerals" in English. However, that is sometimes discouraged as it can lead to confusion with Indian numerals
Support version
Laravel | laravel-modules |
---|---|
5.1 | ^1.0 |
5.8 | ^2.0 |
Install
Via Composer
Usage
If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php
:
If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider.
That's it! by default package automatic transform all eastern
numbers to arabic
for all requests
Package includes two middleware
- "eastern-to-arabic" to transform numbers from eastern to arabic (i.e
١٢٣
to123
) - "arabic-to-eastern" to transform numbers from arabic to eastern (i.e
123
to١٢٣
)
You can use middleware for custom router for example
you can ignore fields from transform by pass fields name as parameters to middleware for example
inline ignore fields not work if auto_register_middleware enable and middleware you want to use inside auto_middleware option, instead you can set ignore fields in config file arabic-numbers-middleware.php
Optional
if you want customizes configuration you can publish the configuration
This is the content of the published config file arabic-numbers-middleware.php
:
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Salah Alkhwlani
- All Contributors
License
The MIT License (MIT). Please see License File for more information.