Files
Virtnet.bond/themes/default/views/client/account/credits.blade.php
2025-11-30 11:57:22 +01:00

45 lines
2.0 KiB
PHP

<div>
<x-navigation.breadcrumb />
<div class="px-2">
<h4 class="text-2xl font-bold pb-3">{{ __('account.credits') }}</h4>
@if (Auth::user()->credits->count() > 0)
<div class="flex flex-wrap gap-4">
@foreach (Auth::user()->credits as $credit)
<div class="flex flex-col bg-primary-700 w-fit rounded-lg px-5 p-3 items-center gap-1">
<h5 class="text-lg font-bold">{{ $credit->currency->code }}</h5>
<p class="text-primary-100">{{ $credit->formattedAmount }}</p>
</div>
@endforeach
</div>
@else
<p>{{ __('account.no_credit') }}</p>
@endif
<h4 class="text-xl font-bold pb-3">{{ __('account.add_credit') }}</h4>
<form wire:submit.prevent="addCredit">
<!-- Currency and amount -->
<div class="grid grid-cols-2 gap-4">
<x-form.select name="currency" :label="__('account.input.currency')" wire:model="currency" required>
@foreach(\App\Models\Currency::all() as $currency)
<option value="{{ $currency->code }}">{{ $currency->code }}</option>
@endforeach
</x-form.select>
<x-form.input x-mask:dynamic="$money($input, '.', '', 2)" name="amount" type="number"
:label="__('account.input.amount')" :placeholder="__('account.input.amount_placeholder')"
wire:model="amount" required />
<x-form.select name="gateway" :label="__('product.payment_method')" wire:model="gateway" required>
@foreach(\App\Models\Gateway::all() as $gateway)
<option value="{{ $gateway->id }}">{{ $gateway->name }}</option>
@endforeach
</x-form.select>
</div>
<x-button.primary type="submit" class="w-full mt-4">
{{ __('account.add_credit') }}
</x-button.primary>
</form>
</div>
</div>