countries icon indicating copy to clipboard operation
countries copied to clipboard

Validation of currency fails due to use of incorrect attribute currency instead of currencies

Open Magentron opened this issue 4 years ago • 0 comments

Using the default validation in Laravel for a currency I got an error while validating e.g. PLN:

        $request->validate([
            ...
            'currency'   => 'required|currencies',
            ..
        ]);

After further analysis it seems the issue is that PragmaRX\Countries\Package\Support\Collection::whereISO4217() is using the wrong attribute currency which should be currencies. After changing that the validation works.

I've created PR #177 which includes a simple test for the function.

PS: Seems to be related to PR #155

Magentron avatar Jul 10 '21 12:07 Magentron