Skip to content

The currency array key is being saved #14

@wrabit

Description

@wrabit

With no currencies selected, app('currency')->get() returns the currency code for the default currency.

Following your example, the index of the array is saved, not the currency code': @foreach(app('currency')->options() as $option) <option value="/currency/{{ $option->value }}" {{ app('currency')->selected($option->value) }} >{{ $option->label }}</option> @Endforeach The Option's value is the keyed integer from the array of currencies not the code: SSD\Currency\Option Object ( [value:SSD\Currency\Option:private] => 0 [label:SSD\Currency\Option:private] => GBP (£) ) So in subsequent calls to app('currency')->get(), it's just giving the integer, not the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions