generated from boboko/starter
price function global (needs review)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
@props([
|
||||
'amount' => null,
|
||||
'currency' => '€',
|
||||
])
|
||||
|
||||
{{-- No wrapper element on purpose — drop this inside whatever tag/classes
|
||||
the call site already uses (span, p, etc). Formatting logic lives in
|
||||
App\Support\Price so it's identical everywhere it's used. --}}
|
||||
{{ \App\Support\Price::format($amount, $currency) }}
|
||||
@@ -28,7 +28,7 @@ class="w-full h-auto block"
|
||||
<div class="flex items-baseline justify-between gap-4">
|
||||
<a href="{{ $href }}" class="font-bold text-xl leading-snug hover:text-brand">{{ $name }}</a>
|
||||
@if($price !== null)
|
||||
<span class="font-bold text-xl shrink-0">$ {{ $price }}</span>
|
||||
<span class="font-bold text-xl shrink-0"><x-ui.price :amount="$price" /></span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user