File: /home/armgroup/libs/resources/views/account/wallets/index.blade.php
@extends('layouts.app')
@section('content')
<div class="container my-5 body-content">
<div class="row">
<div class="col-lg-3 col-sm-12">
@include('account.sidebar')
</div>
<div class="col-lg-9 col-sm-12">
<div class="card">
<h5 class="card-header">{{ __('Wallet') }}
<span class="float-end">
<a href="{{ route('account.wallets.create') }}" class="btn btn-sm btn-primary">
<span class="fa fa-plus"></span> {{ __('Increase credit') }}
</a>
</span>
</h5>
<div class="card-body">
<div class="alert p-3" style="background-color: #eee;">
<livewire:account.card.edit />
</div>
<table class="table table-sm mt-5">
<thead class="thead-dark">
<tr>
<th scope="col">{{ __('Amount') }}</th>
<th scope="col">{{ __('Description') }}</th>
<th scope="col">{{ __('Date') }}</th>
<th scope="col">{{ __('Actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($wallets as $wallet)
<tr>
<td>
<span style="direction: ltr !important;"
class="badge bg-{{ $wallet->amount > 0 ? 'success' : 'danger' }}">
{{ to_persian_numbers(number_format($wallet->amount)) }}
</span>
</td>
<td>{{ words($wallet->description, 15) }}</td>
<td>{{ to_persian_numbers(jdate($wallet->created_at)) }}</td>
<td>
<a href="{{ route('account.wallets.show', $wallet->id) }}" class="btn btn-info btn-sm">
<span class="fa fa-info-circle"></span> {{ __('Detail') }}
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
{{ $wallets->links() }}
<div class="row mt-2">
<div class="col-lg-6 offset-lg-3 col-12">
<div class="alert alert-primary text-center" role="alert">
{{ __('Current Credit') }}: <u>{{ to_persian_numbers(number_format(auth()->user()->credit)) }}</u> {{ __('Toman') }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection