ldc-cocotte/resources/views/fo/modules/guarded-currency.blade.php

13 lines
398 B
PHP

@php
/** @var \Money\Money $money */
if (! isset($productWithPricing) || ! $productWithPricing instanceof \App\Dto\ProductWithPricingDto) {
throw new \InvalidArgumentException('Product must be an instance of ProductWithPricingDto to view prices.');
}
@endphp
@if (Gate::allows('viewPrices', $productWithPricing))
<span>@money($money)</span>
@else
<span>{{ '-.--' }}</span>
@endif