Skip to content

Commit

Permalink
Update currency handling and dependencies for Laravel upgrade
Browse files Browse the repository at this point in the history
Refactor currency-related logic to use default currency settings, removing reliance on `config('app.currency')`. Update PHP and package version requirements to support Laravel 11, ensuring compatibility and alignment with the latest framework features.
  • Loading branch information
fabio-ivona committed Jan 23, 2025
1 parent 866df25 commit 02a6664
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
21 changes: 11 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@
}
],
"require": {
"php": "^8.2",
"php": "^8.4",
"filament/filament": "^3.0",
"spatie/laravel-package-tools": "^1.15.0",
"symfony/intl": "^v7.2.0"
"symfony/intl": "^v7.2.0",
"laravel/framework": "^v11.39"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.9",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.1",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"nunomaduro/collision": "^v8.6.0",
"nunomaduro/larastan": "^v3.0",
"orchestra/testbench": "^v9.9",
"pestphp/pest": "^v3.7",
"pestphp/pest-plugin-arch": "^v3.0",
"pestphp/pest-plugin-laravel": "^v3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0"
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 2 additions & 1 deletion src/Forms/Components/MoneyInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Closure;
use Filament\Forms\Components\TextInput;
use Illuminate\Support\Number;
use Symfony\Component\Intl\Currencies;

class MoneyInput extends TextInput
Expand All @@ -18,7 +19,7 @@ protected function setUp(): void
{
parent::setUp();

$this->numeric()->step(0.01)->prefix(Currencies::getSymbol(config('app.currency')));
$this->numeric()->step(0.01)->prefix(Currencies::getSymbol(Number::defaultCurrency()));

$this->extraInputAttributes(function (MoneyInput $component) {
$inverted_colors = $this->evaluate($this->invertedColors) ? 1 : 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Infolists/Components/MoneyEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function setUp(): void
parent::setUp();

$this->numeric(2)
->prefix(Currencies::getSymbol(config('app.currency')));
->prefix(Currencies::getSymbol());

$this->color(function (?float $state) {
if ($state === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Tables/Columns/MoneyColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function setUp(): void
$state = abs($state);
}

return Number::currency($state, config('app.currency'), config('app.locale'));
return Number::currency($state);
});
}

Expand Down

0 comments on commit 02a6664

Please sign in to comment.