New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

brokeyourbike/money-validation-laravel

Validation rules for Money and Currency
2,850 1
Install
composer require brokeyourbike/money-validation-laravel
Latest Version:1.0.2
PHP:^8.0
Laravel:8 · 9
License:MPL-2.0
Last Updated:May 20, 2023
Links: GitHub  ·  Packagist
Maintainer: brokeyourbike

money-validation-laravel

Latest Stable Version Total Downloads Maintainability Test Coverage

Validation rules for Money and Currency

Installation

composer require brokeyourbike/money-validation-laravel

Usage

Package uses service container for currencies resolution. You can set it in your AppServiceProvider

use Money\Currencies\ISOCurrencies;
use Money\Currencies;

public function register()
{
    $this->app->singleton(Currencies::class, function () {
        return new ISOCurrencies();
    });
}
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

License

Mozilla Public License v2.0

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

651,963,193 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

518,004,183 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

435,097,283 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
1.0.2 ^8.0 ^8|^9 MPL-2.0
1.0.1 ^8.0 ^8|^9 MPL-2.0
1.0.0 ^7.4 || ^8.0 ^8 MPL-2.0