Skip to content

[11.x] feat: add useful defaultLocale and defaultCurrency helpers to Number facade#53101

Merged
taylorotwell merged 4 commits intolaravel:11.xfrom
sts-ryan-holton:feature/helpers_number_global_methods
Oct 10, 2024
Merged

[11.x] feat: add useful defaultLocale and defaultCurrency helpers to Number facade#53101
taylorotwell merged 4 commits intolaravel:11.xfrom
sts-ryan-holton:feature/helpers_number_global_methods

Conversation

@sts-ryan-holton
Copy link
Contributor

Hi 👋,

The following is a very simple PR that allows us to return whatever the application's default $currency and $locale are. I was initially considering changing the variables from protected to public so that we wouldn't need these functions, I'm still open to this.

Usage:

Number::defaultLocale() // returns default locale
Number::defaultCurrency() // returns default currency

@taylorotwell taylorotwell merged commit cdffc89 into laravel:11.x Oct 10, 2024
timacdonald pushed a commit to timacdonald/framework that referenced this pull request Oct 15, 2024
…Number facade (laravel#53101)

* feat: add useful defaultLocale and defaultCurrency helpers to Number facade and tests

* feat: add useful defaultLocale and defaultCurrency helpers to Number facade and tests

* feat: add useful defaultLocale and defaultCurrency helpers to Number facade and tests

* Update Number.php

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants