Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brokeyourbike/money-validation-laravel
Laravel validation rules for Money and Currency
https://github.com/brokeyourbike/money-validation-laravel
currency hacktoberfest laravel laravel-8 laravel-8-package laravel-package money php php8 validation
Last synced: about 1 month ago
JSON representation
Laravel validation rules for Money and Currency
- Host: GitHub
- URL: https://github.com/brokeyourbike/money-validation-laravel
- Owner: brokeyourbike
- License: mpl-2.0
- Created: 2021-10-20T15:04:48.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-20T11:41:41.000Z (over 1 year ago)
- Last Synced: 2024-09-28T20:40:50.294Z (about 2 months ago)
- Topics: currency, hacktoberfest, laravel, laravel-8, laravel-8-package, laravel-package, money, php, php8, validation
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# money-validation-laravel
[![Latest Stable Version](https://img.shields.io/github/v/release/brokeyourbike/money-validation-laravel)](https://github.com/brokeyourbike/money-validation-laravel/releases)
[![Total Downloads](https://poser.pugx.org/brokeyourbike/money-validation-laravel/downloads)](https://packagist.org/packages/brokeyourbike/money-validation-laravel)
[![Maintainability](https://api.codeclimate.com/v1/badges/a81b62866be29368ac32/maintainability)](https://codeclimate.com/github/brokeyourbike/money-validation-laravel/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/a81b62866be29368ac32/test_coverage)](https://codeclimate.com/github/brokeyourbike/money-validation-laravel/test_coverage)Validation rules for Money and Currency
## Installation
```bash
composer require brokeyourbike/money-validation-laravel
```## Usage
Package uses service container for currencies resolution. You can set it in your `AppServiceProvider`
```php
use Money\Currencies\ISOCurrencies;
use Money\Currencies;public function register()
{
$this->app->singleton(Currencies::class, function () {
return new ISOCurrencies();
});
}
``````php
use Illuminate\Foundation\Http\FormRequest;
use BrokeYourBike\MoneyValidation\IsValidCurrency;class ExampleRequest extends FormRequest
{
public function rules()
{
return [
'currency_code' => [
'required',
'string',
'size:3',
new IsValidCurrency(),
],
];
}
}
```## Authors
- [Ivan Stasiuk](https://github.com/brokeyourbike) | [Twitter](https://twitter.com/brokeyourbike) | [LinkedIn](https://www.linkedin.com/in/brokeyourbike) | [stasi.uk](https://stasi.uk)## License
[Mozilla Public License v2.0](https://github.com/brokeyourbike/money-validation-laravel/blob/main/LICENSE)