Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Oct 25, 2023
1 parent 3e577ab commit 6201293
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/BazarServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function registerMacros(): void
{
Str::macro('currency', static function (int|float $value, string $currency = null): string {
return sprintf(
'%s %s', number_format($value, 2), strtoupper($currency ?: Bazar::getCurrency())
'%s %s', number_format($value), strtoupper($currency ?: Bazar::getCurrency())
);
});
}
Expand Down
3 changes: 1 addition & 2 deletions src/Resources/ProductResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public function fields(Request $request): array

Prices::make(),

Media::make(__('Photo'), 'media', 'media')
->collection('primary'),
Media::make(__('Cover'), 'media', 'media'),
]);
}
}
8 changes: 2 additions & 6 deletions src/Traits/HasPrices.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ public function prices(): Prices
protected function price(): Attribute
{
return new Attribute(
get: function (): ?float {
return $this->getPrice();
}
get: fn (): ?float => $this->getPrice(),
);
}

Expand All @@ -40,9 +38,7 @@ protected function price(): Attribute
protected function formattedPrice(): Attribute
{
return new Attribute(
get: function (): ?string {
return $this->getFormattedPrice();
}
get: fn (): ?string => $this->getFormattedPrice(),
);
}

Expand Down

0 comments on commit 6201293

Please sign in to comment.