Fix Blade money directive
This commit is contained in:
parent
a13428ca38
commit
c51aabbc33
2 changed files with 4 additions and 3 deletions
|
|
@ -47,8 +47,9 @@ class ViewServiceProvider extends ServiceProvider
|
|||
$view->with('viewName', $view->getName());
|
||||
});
|
||||
|
||||
Blade::directive('money', function (string|int $amount) {
|
||||
return "app('phpMoneyFormatter')->format(new Money({$amount}, app('phpMoneyCurrency')))";
|
||||
Blade::directive('money', function (string $amountVariable) {
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
return "<?php echo e(app('phpMoneyFormatter')->format(new Money({$amountVariable}, app('phpMoneyCurrency')))); ?>";
|
||||
});
|
||||
|
||||
// * Inject menuNodeList
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
])>{{ $line2 }}</div>
|
||||
</div>
|
||||
@if (!empty($promoAmount))
|
||||
<span class="promo-badge">{{ @money($promoAmount) }}</span>
|
||||
<span class="promo-badge">@money($promoAmount)</span>
|
||||
@endif
|
||||
@if (!empty($membersAmount))
|
||||
<span class="promo-members">{{ number_format($membersAmount, 0, ',', ' ') }} {{ __('membres') }}</span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue